preinst script fails when /proc/sys/kernel/shmmax is too big

Bug #1405501 reported by Alberto Ruiz
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Openbravo ERP
New
Undecided
Unassigned

Bug Description

I am trying to install Openbravo in a Ubuntu Precise Docker container. The value of /proc/sys/kernel/shmmax is 18446744073692774399 which Dash/Bash fails to compare to the minimum SHMMAX value and makes the preinst script abort the package installation.

This prevents the package from being installable as /proc is mounted read-only

Revision history for this message
Gorka Gil (gorka.gil) wrote : Re: [Openbravo-isv] [Bug 1405501] [NEW] preinst script fails when /proc/sys/kernel/shmmax is too big

Hi,

The error was something like this ?
bash: [: 18446744073692774399: integer expression expected

If so, probably means that bash is not able to manage this big number,
by the way this number is around 17 Peta Bytes or 17 thousand million
giga bytes

A server with all this ram nowadays could be quite expensive ;)

Can you try to reduce the shammax to a value like 100 GB?
107374182400 ( 100 * 1024 * 1024 * 1024 )

Regards
Gorka

On Thu, Dec 25, 2014 at 1:20 AM, Alberto Ruiz <email address hidden> wrote:
> Public bug reported:
>
> I am trying to install Openbravo in a Ubuntu Precise Docker container.
> The value of /proc/sys/kernel/shmmax is 18446744073692774399 which
> Dash/Bash fails to compare to the minimum SHMMAX value and makes the
> preinst script abort the package installation.
>
> This prevents the package from being installable as /proc is mounted
> read-only
>
> ** Affects: openbravo-erp
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Openbravo
> ERP, which is subscribed to Openbravo ERP.
> https://bugs.launchpad.net/bugs/1405501
>
> Title:
> preinst script fails when /proc/sys/kernel/shmmax is too big
>
> Status in Openbravo ERP:
> New
>
> Bug description:
> I am trying to install Openbravo in a Ubuntu Precise Docker container.
> The value of /proc/sys/kernel/shmmax is 18446744073692774399 which
> Dash/Bash fails to compare to the minimum SHMMAX value and makes the
> preinst script abort the package installation.
>
> This prevents the package from being installable as /proc is mounted
> read-only
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openbravo-erp/+bug/1405501/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openbravo-isv
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openbravo-isv
> More help : https://help.launchpad.net/ListHelp

Revision history for this message
Alberto Ruiz (alberto.ruiz) wrote :

Hello Gorka,

Yeah, that's the error.

This is the value provided inside a Docker container, for security reasons I cannot change the value at all, so I can't create a Docker container running Openbravo (which is killing me right now because you are not providing a 14.04 PPA plus I really want to serve Openbravo from within a container).

Basically I can't remount /proc/sys as rw at all and I can't tell Docker to use a lower number globally.

Revision history for this message
Gorka Gil (gorka.gil) wrote : Re: [Openbravo-isv] [Bug 1405501] Re: preinst script fails when /proc/sys/kernel/shmmax is too big

Hi Alberto.

Since is a container probably is simply taking the value from the
host, you could try to edit this value in the host.

Regards,
Gorka

On Fri, Dec 26, 2014 at 9:29 AM, Alberto Ruiz <email address hidden> wrote:
> Hello Gorka,
>
> Yeah, that's the error.
>
> This is the value provided inside a Docker container, for security
> reasons I cannot change the value at all, so I can't create a Docker
> container running Openbravo (which is killing me right now because you
> are not providing a 14.04 PPA plus I really want to serve Openbravo from
> within a container).
>
> Basically I can't remount /proc/sys as rw at all and I can't tell Docker
> to use a lower number globally.
>
> --
> You received this bug notification because you are a member of Openbravo
> ERP, which is subscribed to Openbravo ERP.
> https://bugs.launchpad.net/bugs/1405501
>
> Title:
> preinst script fails when /proc/sys/kernel/shmmax is too big
>
> Status in Openbravo ERP:
> New
>
> Bug description:
> I am trying to install Openbravo in a Ubuntu Precise Docker container.
> The value of /proc/sys/kernel/shmmax is 18446744073692774399 which
> Dash/Bash fails to compare to the minimum SHMMAX value and makes the
> preinst script abort the package installation.
>
> This prevents the package from being installable as /proc is mounted
> read-only
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openbravo-erp/+bug/1405501/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openbravo-isv
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openbravo-isv
> More help : https://help.launchpad.net/ListHelp

Revision history for this message
Alberto Ruiz (alberto.ruiz) wrote :

Been there, done that. Nope, it's not just taking it from the host, I've changed the value, restarted docker, and still getting the same value. The only way I can change it is by starting a privileged container, however, I can't "docker build" as privileged so that doesn't solve the problem either.

I have already tried and google for all the obvious and non-obvious things to work around this.

The truth of the matter is that the script is actually broken for valid values of shmmax. pre/post install/rm are delicate scripts that should not be prone to errors due to unexpected/bogus/uncontrolled external input.

It'll be safer to use python -c "print $SHMMAX < $SHMMAX_MIN" and compare that to True or False, or something along those lines.

Revision history for this message
Alberto Ruiz (alberto.ruiz) wrote :

Hello Gorka,

Do you think you can ship a fix for this anytime soon?

Revision history for this message
Stefan Huehner (stefan-huehner) wrote :

Hi Alberto,

not sure when we get around for a fix really
A quick workaround for you maybe to:

1.) apt-get install openbravo-3 (will fail)
2.) vim /var/lib/dpkg/info/openbravo-3.preinst (and comment out the
shmmax adjustment)
as needed one of the following to continue install
3.a) dpkg --configure --pending
3.b) apt-get -f install

Another alternative.
Did you think on using our openbravo appliance image and run that in a
docker container? So no need to take fresh ubuntu + install anything?
As that will give you a much more polished install anyway compared to the ppa?

We do run that image internally in lxc-containers so maybe an
interesting alternative for you.

Stefan

On Sun, Dec 28, 2014 at 5:40 PM, Alberto Ruiz <email address hidden> wrote:
> Hello Gorka,
>
> Do you think you can ship a fix for this anytime soon?
>
> --
> You received this bug notification because you are a member of Openbravo
> ERP, which is subscribed to Openbravo ERP.
> https://bugs.launchpad.net/bugs/1405501
>
> Title:
> preinst script fails when /proc/sys/kernel/shmmax is too big
>
> Status in Openbravo ERP:
> New
>
> Bug description:
> I am trying to install Openbravo in a Ubuntu Precise Docker container.
> The value of /proc/sys/kernel/shmmax is 18446744073692774399 which
> Dash/Bash fails to compare to the minimum SHMMAX value and makes the
> preinst script abort the package installation.
>
> This prevents the package from being installable as /proc is mounted
> read-only
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openbravo-erp/+bug/1405501/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openbravo-isv
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openbravo-isv
> More help : https://help.launchpad.net/ListHelp

Revision history for this message
Alberto Ruiz (alberto.ruiz) wrote :

Hello Stefan,

Thanks for the update, I tried to edit the file but since the default Docker apt configuration removes packages if they fail (both from the cache archive and the dpkg database) I couldn't edit that file. I did try to do it.

Ultimately I'm using lxc, however Docker is a lot more convenient for port redirection, now I have to do iptables stuff manually which I hate. You guys should really consider uploading an openbravo instance to the official docker registry that is capable of linking with a postgresql container.

However, besides my personal problem, I really think you should fix the script, I am sure I am not the only one who has encouentered this and not everybody knows how to work around things or file bugs :-)

Revision history for this message
Devvyn Murphy (devvyn) wrote :

Call me lazy, but I'm in the category of user that is very unlikely to resort to using lxc. For us, it's either Docker or native install on a clean VM, but I'll tell you that life is easier when I can "docker run", which makes me happy and supportive of the project. :)

Revision history for this message
Jarl (jarl-dk) wrote :

I believe this issue is caused by an issue in docker itself not reporting the correct value of shmmax:
https://github.com/docker/docker/issues/10176

I ran into the same problem trying to install Oracle Database 11g XE in centos image using ubuntu 14.10 host with host kernel 3.16.0-44

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.