sandialabs / scot

Sandia Cyber Omni Tracker (SCOT)
http://getscot.sandia.gov
Other
245 stars 48 forks source link

/var/log/mongo directory missing #53

Closed FusionFC closed 6 years ago

FusionFC commented 6 years ago

Building scot from 'master' under Ubuntu 16.04 using latest docker-ce. Upon startup of the mongodb docker image the database does not respond, and will loop forever with: mongodb | => Waiting for confirmation of MongoDB service startup....

This is caused by a missing directory: /var/log/mongodb

Ensuring the directory is created in Dockerfile-Mongodb solves this issue.

brymon68 commented 6 years ago

Fixed. Thanks!

FusionFC commented 6 years ago

Hmm, this didn't pass my testing. This morning, I started with a full clean install environment and cloned the 'master', I see the mkdir in the dockerfile. Yet when I do a full build using ./restart-build-deploy.sh (choosing option 2 for custom), after all is said and done and everything is built I still see: mongodb | 2018-09-07T10:56:49.840-0600 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open "/var/log/mongodb/mongod.log" I attach to the running mongodb container: root@760f8738b459:/# ls -ld /var/log/mongodb ls: cannot access '/var/log/mongodb': No such file or directory I can see in the mongodb portion of the build that the directory creation should happen. I'm not sure what is gong wrong: Building mongodb Step 1/19 : FROM sandialabs/scot_perl ---> b18697127b89 Step 2/19 : RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 ---> Running in f8cec0e760c9 Executing: /tmp/tmp.ZBlbcacbhi/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 gpg: requesting key EA312927 from hkp server keyserver.ubuntu.com gpg: key EA312927: public key "MongoDB 3.2 Release Signing Key <packaging@mongodb.com>" imported gpg: key EA312927: public key "Totally Legit Signing Key <mallory@example.org>" imported gpg: Total number processed: 2 gpg: imported: 2 (RSA: 2) Removing intermediate container f8cec0e760c9 ---> 2faa1f53c8a7 Step 3/19 : RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list ---> Running in 3a12647f551b deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse Removing intermediate container 3a12647f551b ---> c3b6b4a9231e Step 4/19 : RUN apt-get update && apt-get install -y mongodb-org ---> Running in bdb9124f5b46 Ign:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease Hit:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release Get:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg [801 B] Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease Hit:6 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 801 B in 0s (926 B/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed: mongodb-org-mongos mongodb-org-server The following NEW packages will be installed: mongodb-org mongodb-org-mongos mongodb-org-server 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 14.7 MB of archives. After this operation, 57.0 MB of additional disk space will be used. Get:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2/multiverse amd64 mongodb-org-server amd64 3.2.21 [10.0 MB] Get:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2/multiverse amd64 mongodb-org-mongos amd64 3.2.21 [4680 kB] Get:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2/multiverse amd64 mongodb-org amd64 3.2.21 [3560 B] debconf: delaying package configuration, since apt-utils is not installed Fetched 14.7 MB in 1s (9135 kB/s) Selecting previously unselected package mongodb-org-server. (Reading database ... 27694 files and directories currently installed.) Preparing to unpack .../mongodb-org-server_3.2.21_amd64.deb ... Unpacking mongodb-org-server (3.2.21) ... Selecting previously unselected package mongodb-org-mongos. Preparing to unpack .../mongodb-org-mongos_3.2.21_amd64.deb ... Unpacking mongodb-org-mongos (3.2.21) ... Selecting previously unselected package mongodb-org. Preparing to unpack .../mongodb-org_3.2.21_amd64.deb ... Unpacking mongodb-org (3.2.21) ... Setting up mongodb-org-server (3.2.21) ... Adding system usermongodb' (UID 106) ... Adding new user mongodb' (UID 106) with groupnogroup' ... Not creating home directory /home/mongodb'. Adding groupmongodb' (GID 108) ... Done. Adding user mongodb' to groupmongodb' ... Adding user mongodb to group mongodb Done. Setting up mongodb-org-mongos (3.2.21) ... Setting up mongodb-org (3.2.21) ... Removing intermediate container bdb9124f5b46 ---> b9ae5f1fbd9e Step 5/19 : RUN mkdir -p /var/lib/mongodb ---> Running in 658cafaef9d2 Removing intermediate container 658cafaef9d2 ---> bc3f9bb6959d Step 6/19 : EXPOSE 27017 ---> Running in bb698df73528 Removing intermediate container bb698df73528 ---> 2da86a70f0a7 Step 7/19 : ADD docker-configs/mongodb/mongod.conf /etc/mongod.conf ---> 9dad076b0255 Step 8/19 : ADD docker-configs/scot/scot.cfg.pl /opt/scot/etc/ ---> 58dbb0a1bc33 Step 9/19 : ADD docker-configs/mongodb/ / ---> a9fb58208418 Step 10/19 : ADD install/src/mongodb /opt/scot/install/src/mongodb ---> a6600159d5ff Step 11/19 : RUN mkdir -p /var/log/mongodb/ ---> Running in 2066f270a856 Removing intermediate container 2066f270a856 ---> a3c3cdc2c41a Step 12/19 : RUN chmod 0755 /run.sh ---> Running in c1e2802c3c8d Removing intermediate container c1e2802c3c8d ---> bffd5fbb8583 Step 13/19 : RUN chmod 0755 /set_mongodb_config.sh ---> Running in 5c5752a2d2e8 Removing intermediate container 5c5752a2d2e8 ---> 55c63adcfbfb Step 14/19 : ADD demo/ /opt/scot/demo/ ---> 4fc99827376b Step 15/19 : RUN usermod -u 1061 mongodb ---> Running in 73e705dddb0f Removing intermediate container 73e705dddb0f ---> 03598b5335e2 Step 16/19 : RUN groupadd -g 2060 scot && usermod -a -G 2060 mongodb ---> Running in 1c618ec26c31 Removing intermediate container 1c618ec26c31 ---> 9b11df6a4431 Step 17/19 : RUN chown -R 1061:2060 /var/log/mongodb /var/lib/mongodb/ ---> Running in 217dce7434d7 Removing intermediate container 217dce7434d7 ---> 52852515cda8 Step 18/19 : USER mongodb:mongodb ---> Running in 0ce8a161bdd8 Removing intermediate container 0ce8a161bdd8 ---> 5efb92d5d34e Step 19/19 : CMD ["/run.sh"] ---> Running in 28f8e1810d49 Removing intermediate container 28f8e1810d49 ---> 467994024673

Successfully built 467994024673 Successfully tagged sandialabs/scot_mongodb:latest`

brymon68 commented 6 years ago

Im wondering if that log file just needs to be present (which it currently is not) and the build will continue? Would you be able to test that? We are currently working on getting some infrastructure in place to be build these containers on command and blow away the host so we can start fresh each build. I should have that in place by early next week. Let me know how it goes.

brymon68 commented 6 years ago

@FusionFC - I performed a test up at Google Cloud and it looks like the restart script wasn't creating the /var/log/mongodb/ directory. Once I added that to the script, everything built. I will update when I return to work on Monday and will follow up once new code has been pushed. Feel free to follow up with any questions or concerns. Thanks for catching this for us!

brymon68 commented 6 years ago

@FusionFC - Script updated. Let me know if you run into any further issues.

FusionFC commented 6 years ago

Tested and working.