Skip to content
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

Podman - Failed global initialization: FileNotOpen: Failed to open "/opt/bitnami/mongodb/logs/mongodb.log" #444

Closed
nccurry opened this issue Apr 1, 2020 · 6 comments

Comments

@nccurry
Copy link

nccurry commented Apr 1, 2020

[root@fcos ~]# rpm-ostree status
State: idle
AutomaticUpdates: disabled
Deployments:
● ostree://fedora:fedora/x86_64/coreos/stable
                   Version: 31.20200310.3.0 (2020-03-25T19:42:10Z)
                    Commit: 436592e6eb93e899bebab8dbd17514c85be683390ef8bbce8c6d96069ce4c543
              GPGSignature: Valid signature by 7D22D5867F2A4236474BF7B850CB390B3C3359C4

Description

MongoDB fails to start when running with podman on Fedora CoreOS.

2020-03-31T19:27:56.409+0000 F CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/opt/bitnami/mongodb/logs/mongodb.log"

Steps to reproduce the issue:

  1. Deploy Fedora CoreOS host
  2. Try to deploy image

Describe the results you received:

[root@fcos ~]# /usr/bin/podman run -p 27017:27017 -e MONGODB_USERNAME=user -e MONGODB_PASSWORD=password -e MONGODB_DATABASE=database -e MONGODB_SYSTEM_LOG_VERBOSITY=5 -e MONGODB_ROOT_PASSWORD=passwordrootmongodb  bitnami/mongodb:latest                                                               19:27:54.58 
 19:27:54.58 Welcome to the Bitnami mongodb container
 19:27:54.59 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mongodb
 19:27:54.59 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mongodb/issues
 19:27:54.59 Send us your feedback at [email protected]
 19:27:54.59 
 19:27:54.59 INFO  ==> ** Starting MongoDB setup **
 19:27:54.60 INFO  ==> Validating settings in MONGODB_* env vars...
 19:27:54.60 INFO  ==> Initializing MongoDB...
 19:27:54.60 INFO  ==> No injected configuration files found. Creating default config files...
 19:27:54.60 INFO  ==> Deploying MongoDB from scratch...
 19:27:55.08 INFO  ==> Creating users...
 19:27:55.08 INFO  ==> Creating root user...
 19:27:55.22 INFO  ==> Creating 'user' user...
 19:27:55.32 INFO  ==> Users created
 19:27:55.32 INFO  ==> Stopping MongoDB...
 19:27:56.34 INFO  ==> Enabling authentication...
 19:27:56.36 INFO  ==> 
 19:27:56.36 INFO  ==> ########################################################################
 19:27:56.36 INFO  ==>  Installation parameters for MongoDB:
 19:27:56.37 INFO  ==>   User Name: user
 19:27:56.37 INFO  ==>   Password: **********
 19:27:56.37 INFO  ==>   Database: database
 19:27:56.37 INFO  ==> (Passwords are not shown for security reasons)
 19:27:56.37 INFO  ==> ########################################################################
 19:27:56.37 INFO  ==> 
 19:27:56.38 INFO  ==> Loading custom scripts...
find: '/docker-entrypoint-initdb.d/': No such file or directory
 19:27:56.38 INFO  ==> ** MongoDB setup finished! **

 19:27:56.39 INFO  ==> ** Starting MongoDB **
2020-03-31T19:27:56.409+0000 F CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/opt/bitnami/mongodb/logs/mongodb.log"

Describe the results you expected:

Running container image

Additional information you deem important (e.g. issue happens only occasionally):

Version

[root@fcos ~]# podman version
Version:            1.8.1
RemoteAPI Version:  1
Go Version:         go1.13.6
OS/Arch:            linux/amd64
[root@fcos ~]# podman info
host:
  BuildahVersion: 1.14.2
  CgroupVersion: v1
  Conmon:
    package: conmon-2.0.10-2.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.10, commit: 6b526d9888abb86b9e7de7dfdeec0da98ad32ee0'
  Distribution:
    distribution: fedora
    version: "31"
  MemFree: 1177010176
  MemTotal: 2077835264
  OCIRuntime:
    name: crun
    package: crun-0.12.2.1-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.12.2.1
      commit: cd7cea7114db5f6aa35fbb69fa307c19c2728a31
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 1
  eventlogger: journald
  hostname: fcos
  kernel: 5.5.8-200.fc31.x86_64
  os: linux
  rootless: false
  uptime: 2h 26m 37.4s (Approximately 0.08 days)
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - quay.io
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 13
  GraphDriverName: overlay
  GraphOptions:
    overlay.mountopt: nodev,metacopy=on
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  ImageStore:
    number: 3
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

Additional environment details (AWS, VirtualBox, Docker for MAC, physical, etc.):

QEMU/KVM on Fedora 31 host

@lucab
Copy link
Contributor

lucab commented Apr 1, 2020

Thanks for the report.

@nccurry reading around, I think that /opt/bitnami/mongodb/logs/mongodb.log is a symlink to /dev/stdout, can you confirm that?

@giuseppe I think this a conmon/crun bug that you already worked on recently, can you double-check if it is the case?

@nccurry
Copy link
Author

nccurry commented Apr 1, 2020

You are correct. I spun a container up on my Fedora 31 laptop and can see the following:

1001@6101829c1505:/$ ls -lah /opt/bitnami/mongodb/logs             
total 0
drwxrwxr-x. 2 root root 25 Jan 23 01:10 .
drwxrwxr-x. 1 root root 29 Jan 23 01:10 ..
lrwxrwxrwx. 1 root root 11 Jan 23 01:10 mongodb.log -> /dev/stdout

@lucab
Copy link
Contributor

lucab commented Apr 1, 2020

I spun a container up on my Fedora 31 laptop

That's interesting, was it with podman too and can you post the podman info from there?

@nccurry
Copy link
Author

nccurry commented Apr 1, 2020

Fedora 31

[ncc@t490s ~]$ podman info
host:
  BuildahVersion: 1.14.3
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.14-1.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.14, commit: 083a0be12178013d44ff51ceda3090ea741b6516'
  Distribution:
    distribution: fedora
    version: "31"
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  MemFree: 21629050880
  MemTotal: 33441513472
  OCIRuntime:
    name: crun
    package: crun-0.13-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.13
      commit: e79e4de4ac16da0ce48777afb72c6241de870525
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 15725297664
  SwapTotal: 16793989120
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: t490s
  kernel: 5.5.11-200.fc31.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-0.4.0-20.1.dev.gitbbd6f25.fc31.x86_64
    Version: |-
      slirp4netns version 0.4.0-beta.3+dev
      commit: bbd6f25c70d5db2a1cd3bfb0416a8db99a75ed7e
  uptime: 72h 11m 4.26s (Approximately 3.00 days)
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - quay.io
store:
  ConfigFile: /home/ncc/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.7.8-1.fc31.x86_64
      Version: |-
        fusermount3 version: 3.6.2
        fuse-overlayfs: version 0.7.8
        FUSE library version 3.6.2
        using FUSE kernel interface version 7.29
  GraphRoot: /home/ncc/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 1
  RunRoot: /run/user/1000/containers
  VolumePath: /home/ncc/.local/share/containers/storage/volumes

Fedora CoreOS 31.20200310.3.0

[root@fcos ~]# podman info
host:
  BuildahVersion: 1.14.2
  CgroupVersion: v1
  Conmon:
    package: conmon-2.0.10-2.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.10, commit: 6b526d9888abb86b9e7de7dfdeec0da98ad32ee0'
  Distribution:
    distribution: fedora
    version: "31"
  MemFree: 1126207488
  MemTotal: 2077835264
  OCIRuntime:
    name: crun
    package: crun-0.12.2.1-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.12.2.1
      commit: cd7cea7114db5f6aa35fbb69fa307c19c2728a31
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 1
  eventlogger: journald
  hostname: fcos
  kernel: 5.5.8-200.fc31.x86_64
  os: linux
  rootless: false
  uptime: 21h 0m 1.43s (Approximately 0.88 days)
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - quay.io
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 13
  GraphDriverName: overlay
  GraphOptions:
    overlay.mountopt: nodev,metacopy=on
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  ImageStore:
    number: 3
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

@nccurry
Copy link
Author

nccurry commented Apr 1, 2020

Running this container image against a newer version of Fedora CoreOS seems to resolve the issue. Let me do more testing to verify and I'll close this issue.

[root@fcos ~]# rpm-ostree status
State: idle
AutomaticUpdates: disabled
Deployments:
● ostree://fedora:fedora/x86_64/coreos/testing-devel
                   Version: 31.20200331.20.0 (2020-03-31T20:59:52Z)
                    Commit: 2862835c958f51ae18cfaebbc8cbdfb91b9da55a971913397b216fae9f33fa86
              GPGSignature: Valid signature by 7D22D5867F2A4236474BF7B850CB390B3C3359C4
[root@fcos ~]# podman info
host:
  BuildahVersion: 1.14.3
  CgroupVersion: v1
  Conmon:
    package: conmon-2.0.14-1.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.14, commit: 083a0be12178013d44ff51ceda3090ea741b6516'
  Distribution:
    distribution: fedora
    version: "31"
  MemFree: 1101180928
  MemTotal: 2077835264
  OCIRuntime:
    name: crun
    package: crun-0.13-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.13
      commit: e79e4de4ac16da0ce48777afb72c6241de870525
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 1
  eventlogger: journald
  hostname: fcos
  kernel: 5.5.11-200.fc31.x86_64
  os: linux
  rootless: false
  uptime: 2m 8.87s
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - quay.io
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 1
  GraphDriverName: overlay
  GraphOptions:
    overlay.mountopt: nodev,metacopy=on
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  ImageStore:
    number: 1
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes
[root@fcos ~]# /usr/bin/podman run -p 27017:27017 -e MONGODB_USERNAME=user -e MONGODB_PASSWORD=password -e MONGODB_DATABASE=database -e MONGODB_SYSTEM_LOG_VERBOSITY=5 -e MONGODB_ROOT_PASSWORD=passwordrootmongodb  bitnami/mongodb:latest
 14:16:04.96 
 14:16:04.96 Welcome to the Bitnami mongodb container
 14:16:04.96 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mongodb
 14:16:04.96 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mongodb/issues
 14:16:04.96 Send us your feedback at [email protected]
 14:16:04.96 
 14:16:04.96 INFO  ==> ** Starting MongoDB setup **
 14:16:04.97 INFO  ==> Validating settings in MONGODB_* env vars...
 14:16:04.97 INFO  ==> Initializing MongoDB...
 14:16:04.98 INFO  ==> No injected configuration files found. Creating default config files...
 14:16:04.98 INFO  ==> Deploying MongoDB from scratch...
 14:16:05.49 INFO  ==> Creating users...
 14:16:05.49 INFO  ==> Creating root user...
 14:16:05.57 INFO  ==> Creating 'user' user...
 14:16:05.66 INFO  ==> Users created
 14:16:05.66 INFO  ==> Stopping MongoDB...
 14:16:06.68 INFO  ==> Enabling authentication...
 14:16:06.70 INFO  ==> 
 14:16:06.70 INFO  ==> ########################################################################
 14:16:06.70 INFO  ==>  Installation parameters for MongoDB:
 14:16:06.71 INFO  ==>   User Name: user
 14:16:06.71 INFO  ==>   Password: **********
 14:16:06.71 INFO  ==>   Database: database
 14:16:06.71 INFO  ==> (Passwords are not shown for security reasons)
 14:16:06.71 INFO  ==> ########################################################################
 14:16:06.71 INFO  ==> 
 14:16:06.73 INFO  ==> Loading custom scripts...
find: '/docker-entrypoint-initdb.d/': No such file or directory
 14:16:06.74 INFO  ==> ** MongoDB setup finished! **

 14:16:06.75 INFO  ==> ** Starting MongoDB **
2020-04-01T14:16:06.763+0000 I CONTROL  [main] ***** SERVER RESTARTED *****
2020-04-01T14:16:06.766+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-01T14:16:06.768+0000 D NETWORK  [main] fd limit hard:1048576 soft:1048576 max conn: 838860
2020-04-01T14:16:06.769+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/bitnami/mongodb/data/db 64-bit host=3a0af87219c3
2020-04-01T14:16:06.769+0000 I CONTROL  [initandlisten] db version v4.0.14
2020-04-01T14:16:06.769+0000 I CONTROL  [initandlisten] git version: 1622021384533dade8b3c89ed3ecd80e1142c132
...

@lucab
Copy link
Contributor

lucab commented Apr 1, 2020

I think this is fixed by containers/conmon#112, which will reach FCOS with conmon 2.0.11 (likely in the next testing release).

@nccurry nccurry closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants