New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error executing 'postInstallation' #88

Open
tyler-durd3n opened this Issue Nov 9, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@tyler-durd3n

tyler-durd3n commented Nov 9, 2017

Description

Unable to deploy drupal chart using helm, or using provided manifest.
Pod with drupal always restarting with different error, mainly with ownership error:

  • Error executing 'postInstallation': Group 'someID' not found

  • Error executing 'postInstallation': User 'someID' not found

  • or one more interesting:

mysql-c INFO  MySQL server listening and working at drupal-ext-mariadb:3306
drupal  INFO  Updating Drupal database ...
Error executing 'postInstallation': Unexpected token <
Unexpected token <

Steps to reproduce the issue:

  1. just using provided manifest
kubectl create -f https://raw.githubusercontent.com/bitnami/bitnami-docker-drupal/master/kubernetes.yml

I've got this:

core@server29 ~ $ kubectl get po | egrep maria\|drupal
drupal-79df44747b-gw8bt                   1/1       Running   0          28s
mariadb-57bc5cf446-knjmn                  1/1       Running   0          28s
core@server29 ~ $ kubectl logs drupal-79df44747b-gw8bt -f

Welcome to the Bitnami drupal container
Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-drupal
Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-drupal/issues
Send us your feedback at containers@bitnami.com

nami    INFO  Initializing apache
apache  INFO  ==> Patching httpoxy...
nami    INFO  apache successfully initialized
nami    INFO  Initializing php
nami    INFO  php successfully initialized
nami    INFO  Initializing drupal
mysql-c INFO  Trying to connect to MySQL server
mysql-c INFO  Found MySQL server listening at mariadb:3306
mysql-c INFO  MySQL server listening and working at mariadb:3306
drupal  INFO  Passing wizard, please be patient
drupal  INFO  Cleaning the cache..
Error executing 'postInstallation': Group '2001' not found

But there are no such group or user id inside:

core@server29 ~ $ echo '
> apiVersion: extensions/v1beta1
> kind: Deployment
> metadata:
>   name: drupal
>   namespace: default
> spec:
>   template:
>     spec:
>       containers:
>       - name: drupal
>         command:
>         - sleep
>         - 1d
> ' | kubectl apply -f -
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
deployment "drupal" configured
core@server29 ~ $ kubectl get po | egrep maria\|drupal
drupal-864d7d9bbf-prkc6                   1/1       Running   0          39s
mariadb-57bc5cf446-knjmn                  1/1       Running   0          22m
core@server29 ~ $ kubectl exec -it drupal-864d7d9bbf-prkc6 /bin/bash
root@drupal-864d7d9bbf-prkc6:/# ls -lha bitnami/                                                                                                                                                                 
total 28K
drwxr-xr-x. 5 root root 4.0K Nov  9 10:34 .
drwxr-xr-x. 1 root root 4.0K Nov  9 10:34 ..
drwxrwsr-x. 4 root 2010 4.0K Nov  9 10:16 apache
drwxrwsr-x. 7 root 2001 4.0K Nov  9 10:16 drupal
drwxrwsr-x. 4 root 2011 4.0K Nov  9 10:16 php
root@drupal-864d7d9bbf-prkc6:/# (cat /etc/group; cat /etc/sudoers) | egrep 2010\|2001\|2011\|bitnami                                                                                                             
bitnami:x:1000:
bitnami ALL=NOPASSWD: ALL
root@drupal-864d7d9bbf-prkc6:/# 

Versions

kubectl version
Client Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.3", GitCommit:"6a4203eb4b5f59ac7a602e0c83023d15d991fd58", GitTreeState:"clean", BuildDate:"2017-08-23T22:58:52Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.1-dirty", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"dirty", BuildDate:"2017-10-19T11:36:32Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}
@dbarranco

This comment has been minimized.

Member

dbarranco commented Nov 15, 2017

Hi @tyler-durd3n

I tried to reproduce this issue following the command you shared in minikube and in a cluster installed through kubeadm, could you please point me where are you deploying this?

In the containe of Drupal or mysql we are not creating any group or user as we do in other containers. So this is a weird error.
Kind regards.

@tyler-durd3n

This comment has been minimized.

tyler-durd3n commented Nov 15, 2017

Hello @dbarranco

Actually we're using kubernetes on CoreOS, and we faced described problem.
About creating user/groups I suppose problem near chown or mkdir with probably wrong passed options in bitnami/core, I've tried to find options source but couldn't manage it.

And using docker (through manual steps) to start services locally - all ok, it works.

uname -a
Linux server43 4.11.9-coreos #1 SMP Thu Jul 6 00:54:42 UTC 2017 x86_64 Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz GenuineIntel GNU/Linux
@dbarranco

This comment has been minimized.

Member

dbarranco commented Nov 16, 2017

Hi @tyler-durd3n

In order to debug this issue better... Have you tried to add the env var to the Drupal pod NAMI_LOG_LEVEL=trace?
That would show you the exactly operation the pod was doing before crashing. So we can take any actions with that information.

Kind regards.

@tyler-durd3n

This comment has been minimized.

tyler-durd3n commented Nov 16, 2017

Greate, I've made as you @dbarranco described, take a look please:

kubectl logs drupal-594f84dc8b-jcnvs -f 

Welcome to the Bitnami drupal container
Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-drupal
Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-drupal/issues
Send us your feedback at containers@bitnami.com

nami    INFO  Initializing apache
apache  INFO  ==> Patching httpoxy...
apache  TRACE [prepareDataToPersist] Preparing /opt/bitnami/apache/conf to persist in /bitnami/apache/conf
nami    INFO  apache successfully initialized
nami    INFO  Initializing php
php     DEBUG Adding php to bitnami environment
php     DEBUG Property user not present in main configuration file. Checking 'www.conf'
php     DEBUG Property group not present in main configuration file. Checking 'www.conf'
php     DEBUG Property pm not present in main configuration file. Checking 'www.conf'
php     DEBUG Property listen not present in main configuration file. Checking 'www.conf'
php     TRACE [prepareDataToPersist] Preparing /opt/bitnami/php/conf to persist in /bitnami/php/conf
nami    INFO  php successfully initialized
nami    INFO  Initializing drupal
apache  TRACE Skipping reload: com.bitnami.apache not running
mysql-c INFO  Trying to connect to MySQL server
mysql-c INFO  Found MySQL server listening at mariadb:3306
mysql-c TRACE [canConnect] Testing connection with 'root' user
mysql-c TRACE [showDatabases] Getting databases for 'root' user
mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -uroot -e SHOW DATABASES;
mysql-c TRACE [execute] Result: {"code":0,"stdout":"information_schema\nmysql\nperformance_schema\n","stderr":""}
mysql-c TRACE [showDatabases] Databases: information_schema
mysql
performance_schema

mysql-c TRACE [canConnect] Connection with 'root' user is successful
mysql-c INFO  MySQL server listening and working at mariadb:3306
mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -uroot -e SHOW DATABASES;
mysql-c TRACE [execute] Result: {"code":0,"stdout":"information_schema\nmysql\nperformance_schema\n","stderr":""}
mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -uroot -e CREATE DATABASE IF NOT EXISTS `bitnami_drupal`
mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -uroot -e GRANT ALL ON `bitnami_drupal`.* TO 'bn_drupal'@'%' IDENTIFIED BY 'ugyTzNFfgY'
mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
drupal  DEBUG Preparing apache environment...
apache  TRACE Skipping reload: com.bitnami.apache not running
drupal  DEBUG Preparing Drupal environment...
drupal  DEBUG Installing Drupal...
apache  TRACE [runProgram] Executing: null /opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf
apache  TRACE code: 0
apache  TRACE stdout:

apache  TRACE stderr:

drupal  INFO  Passing wizard, please be patient
drupal  TRACE [prepareDataToPersist] Preparing /opt/bitnami/drupal/sites to persist in /bitnami/drupal/sites
drupal  TRACE [prepareDataToPersist] Preparing /opt/bitnami/drupal/themes to persist in /bitnami/drupal/themes
drupal  TRACE [prepareDataToPersist] Preparing /opt/bitnami/drupal/modules to persist in /bitnami/drupal/modules
drupal  TRACE [prepareDataToPersist] Preparing /opt/bitnami/drupal/profiles to persist in /bitnami/drupal/profiles
drupal  INFO  Cleaning the cache..
drupal  TRACE [runProgram] Executing: drush cr
drupal  TRACE [configurePermissions] File to chown: /bitnami/drupal/themes
drupal  TRACE [configurePermissions] File to chown: /bitnami/drupal/modules
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default/files
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 19 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 18 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 17 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 16 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 15 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 14 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 13 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 12 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 11 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 10 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 9 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 8 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 7 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 6 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 5 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 4 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 3 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 2 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 1 remaining attempts
drupal  TRACE [configurePermissions] File to chown: /opt/bitnami/drupal/sites/default
drupal  TRACE [retry] Trying to configure permissions... 0 remaining attempts
Error executing 'postInstallation': Group '2004' not found
nami    TRACE Error: Error executing 'postInstallation': Group '2004' not found
    at _findGroup (/opt/bitnami/nami/node_modules/nami-utils/lib/os/user-management/find-group.js:10:11)
    at findGroup (/opt/bitnami/nami/node_modules/nami-utils/lib/os/user-management/find-group.js:37:10)
    at getGid (/opt/bitnami/nami/node_modules/nami-utils/lib/os/user-management/get-gid.js:22:25)
    at _chown (/opt/bitnami/nami/node_modules/nami-utils/lib/file/chown.js:22:33)
    at /opt/bitnami/nami/node_modules/nami-utils/lib/file/chown.js:77:7
    at ot (/opt/bitnami/nami/node_modules/lodash/index.js:12:507)
    at Function.<anonymous> (/opt/bitnami/nami/node_modules/lodash/index.js:33:421)
    at Object.chown (/opt/bitnami/nami/node_modules/nami-utils/lib/file/chown.js:76:7)
    at Object.wrappedFn (/opt/bitnami/nami/node_modules/nami-utils/lib/function-wrapping.js:191:17)
    at _configurePermissions (/root/.nami/components/com.bitnami.drupal/lib/component.js:137:13)
    at utilsFunctions.retry (/root/.nami/components/com.bitnami.drupal/lib/component.js:173:13)
    at Object.retry (/root/.nami/components/com.bitnami.drupal/lib/utils.js:28:14)
    at _.each (/root/.nami/components/com.bitnami.drupal/lib/component.js:165:24)
    at ot (/opt/bitnami/nami/node_modules/lodash/index.js:12:507)
    at Function.<anonymous> (/opt/bitnami/nami/node_modules/lodash/index.js:33:421)
    at Function.<anonymous> (/opt/bitnami/nami/node_modules/lodash/index.js:33:285)
core@server29 ~ $
@MaksymTrykur

This comment has been minimized.

MaksymTrykur commented Nov 16, 2017

The problem is more clear now.
We are using GlusterFS for persistence which allocates random gid for provisioned volume, this group will be supplementary for the container with mounted volume.

# id -a
uid=0(root) gid=0(root) groups=0(root),2004,2005,2006

From stack trace, wizard fails because of the JS implementation of chown that tries to find current gid (2004) in /etc/group before executing chown to the new value (daemon, 1).

# cat /etc/group
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:
fax:x:21:
voice:x:22:
cdrom:x:24:
floppy:x:25:
tape:x:26:
sudo:x:27:
audio:x:29:
dip:x:30:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
bitnami:x:1000:
@silviofdez

This comment has been minimized.

silviofdez commented Nov 20, 2017

@MaksymTrykur, @tyler-durd3n that is a known issue when the file systems is a bit "tricky" with file permissions. We have it on our wishlist but it is not one of our priorities right now. The problem is that, if we do not set up permissions correctly, it could end in an unexpected behavior of the chart later on.

Thank you very much for the info, I hope we can address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment