Netflix / lemur-docker

Docker files for the Lemur certificate orchestration tool
170 stars 83 forks source link

docker-compose up throws error #17

Closed videlanicolas closed 7 years ago

videlanicolas commented 7 years ago

When building the container, docker-compose throws an error with your Dockerfile:

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/local/src/lemur/npm-debug.log
npm ERR! not ok code 0

root@d81fe552ff59:/usr/local/src/lemur# cat /usr/local/src/lemur/npm-debug.log
1325 verbose tar unpack /root/.npm/isarray/0.0.1/package.tgz
1326 silly lockFile 660d49c6-able-stream-node-modules-isarray tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/isarray
1327 verbose lock tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/isarray /root/.npm/660d49c6-able-stream-node-modules-isarray.lock
1328 silly lockFile 44b8127c-ot-npm-isarray-0-0-1-package-tgz tar:///root/.npm/isarray/0.0.1/package.tgz
1329 verbose lock tar:///root/.npm/isarray/0.0.1/package.tgz /root/.npm/44b8127c-ot-npm-isarray-0-0-1-package-tgz.lock
1330 verbose tar unpack /root/.npm/core-util-is/1.0.2/package.tgz
1331 silly lockFile 1dd5bc47-stream-node-modules-core-util-is tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is
1332 verbose lock tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is /root/.npm/1dd5bc47-stream-node-modules-core-util-is.lock
1333 silly lockFile f66db8e6-m-core-util-is-1-0-2-package-tgz tar:///root/.npm/core-util-is/1.0.2/package.tgz
1334 verbose lock tar:///root/.npm/core-util-is/1.0.2/package.tgz /root/.npm/f66db8e6-m-core-util-is-1-0-2-package-tgz.lock
1335 verbose tar unpack /root/.npm/string_decoder/0.10.31/package.tgz
1336 silly lockFile 941a3851-ream-node-modules-string-decoder tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder
1337 verbose lock tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder /root/.npm/941a3851-ream-node-modules-string-decoder.lock
1338 silly lockFile bcea0786-ring-decoder-0-10-31-package-tgz tar:///root/.npm/string_decoder/0.10.31/package.tgz
1339 verbose lock tar:///root/.npm/string_decoder/0.10.31/package.tgz /root/.npm/bcea0786-ring-decoder-0-10-31-package-tgz.lock
1340 verbose tar unpack /root/.npm/inherits/2.0.3/package.tgz
1341 silly lockFile 25525aa8-ble-stream-node-modules-inherits tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/inherits
1342 verbose lock tar:///usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/through2/node_modules/readable-stream/node_modules/inherits /root/.npm/25525aa8-ble-stream-node-modules-inherits.lock
1343 silly lockFile df8e3b88-t-npm-inherits-2-0-3-package-tgz tar:///root/.npm/inherits/2.0.3/package.tgz
1344 verbose lock tar:///root/.npm/inherits/2.0.3/package.tgz /root/.npm/df8e3b88-t-npm-inherits-2-0-3-package-tgz.lock
1345 verbose tar unpack /root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/tmp.tgz
1346 silly lockFile 9d3a35e9-40205-0-7103624257724732-package tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/package
1347 verbose lock tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/package /root/.npm/9d3a35e9-40205-0-7103624257724732-package.lock
1348 silly lockFile 757a8e2c-40205-0-7103624257724732-tmp-tgz tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/tmp.tgz
1349 verbose lock tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/tmp.tgz /root/.npm/757a8e2c-40205-0-7103624257724732-tmp-tgz.lock
1350 silly gunzTarPerm modes [ '755', '644' ]
1351 silly gunzTarPerm modes [ '755', '644' ]
1352 silly gunzTarPerm modes [ '755', '644' ]
1353 silly gunzTarPerm modes [ '755', '644' ]
1354 silly gunzTarPerm modes [ '755', '644' ]
1355 error tar.unpack error reading /root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/tmp.tgz
1356 silly lockFile 9d3a35e9-40205-0-7103624257724732-package tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/package
1357 silly lockFile 9d3a35e9-40205-0-7103624257724732-package tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/package
1358 silly lockFile 757a8e2c-40205-0-7103624257724732-tmp-tgz tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/tmp.tgz
1359 silly lockFile 757a8e2c-40205-0-7103624257724732-tmp-tgz tar:///root/tmp/npm-42-zVsVm-QY/1492696340205-0.7103624257724732/tmp.tgz
1360 silly lockFile 6b880e7f-notifier-node-notifier-4-6-1-tgz https://registry.npmjs.org/node-notifier/-/node-notifier-4.6.1.tgz
1361 silly lockFile 6b880e7f-notifier-node-notifier-4-6-1-tgz https://registry.npmjs.org/node-notifier/-/node-notifier-4.6.1.tgz
1362 silly lockFile bd197a0f-node-notifier-4-6-1 node-notifier@4.6.1
1363 silly lockFile bd197a0f-node-notifier-4-6-1 node-notifier@4.6.1
1364 silly lockFile 9e77e108-node-notifier-4-1-0 node-notifier@^4.1.0
1365 silly lockFile 9e77e108-node-notifier-4-1-0 node-notifier@^4.1.0
1366 silly gunzTarPerm extractEntry templates/helpers/sum.js
1367 silly gunzTarPerm extractEntry templates/json/help-lookup.json
1368 silly gunzTarPerm extractEntry test/data/test_atruler/atruler.c.2.css
1369 silly gunzTarPerm extractEntry test/data/test_atruler/atruler.0.css
1370 verbose about to build /usr/local/src/lemur/node_modules/gulp-notify
1371 info /usr/local/src/lemur/node_modules/gulp-notify unbuild
1372 info preuninstall gulp-notify@2.2.0
1373 info uninstall gulp-notify@2.2.0
1374 verbose true,/usr/local/src/lemur/node_modules,/usr/local/src/lemur/node_modules unbuild gulp-notify@2.2.0
1375 info postuninstall gulp-notify@2.2.0
1376 silly gunzTarPerm extractEntry package.json
1377 silly gunzTarPerm extractEntry test/data/test_atruler/atruler.0.p
1378 silly gunzTarPerm extractEntry test/data/test_atruler/atruler.1.css
1379 silly gunzTarPerm extractEntry README.md
1380 silly gunzTarPerm extractEntry index.js
1381 silly gunzTarPerm extractEntry package.json
1382 silly gunzTarPerm extractEntry package.json
1383 silly gunzTarPerm extractEntry package.json
1384 silly gunzTarPerm extractEntry README.md
1385 silly gunzTarPerm extractEntry LICENSE
1386 silly gunzTarPerm extractEntry .npmignore
1387 silly gunzTarPerm extractEntry README.md
1388 silly gunzTarPerm extractEntry README.md
1389 silly gunzTarPerm extractEntry inherits.js
1390 silly gunzTarPerm extractEntry test/data/test_atruler/atruler.1.l
1391 silly gunzTarPerm extractEntry test/data/test_atruler/atruler.1.p
1392 silly gunzTarPerm extractEntry build/build.js
1393 silly gunzTarPerm extractEntry component.json
1394 error Error: ENOENT, lstat '/usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/applause/node_modules/js-yaml/dist/js-yaml.js'
1395 error If you need help, you may report this log at:
1395 error     <http://github.com/isaacs/npm/issues>
1395 error or email it to:
1395 error     <npm-@googlegroups.com>
1396 error System Linux 4.4.0-1013-aws
1397 error command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--unsafe-perm"
1398 error cwd /usr/local/src/lemur
1399 error node -v v0.10.25
1400 error npm -v 1.3.10
1401 error path /usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/applause/node_modules/js-yaml/dist/js-yaml.js
1402 error fstream_path /usr/local/src/lemur/node_modules/gulp-replace-task/node_modules/applause/node_modules/js-yaml/dist/js-yaml.js
1403 error fstream_type File
1404 error fstream_class FileWriter
1405 error code ENOENT
1406 error errno 34
1407 error fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
1407 error fstream_stack Object.oncomplete (fs.js:107:15)
1408 verbose exit [ 34, true ]

The command failing is the following:

make develop

Same issue appears if I try only to make.

videlanicolas commented 7 years ago

With the latest merge, the docker-compose up works until this point:


lemur-web_1    | Waiting for db to become available
lemur-web_1    | Attempt to connect to db.. try #1
lemur-web_1    | psql: could not connect to server: Connection refused
lemur-web_1    |    Is the server running on host "postgres" (172.17.0.3) and accepting
lemur-web_1    |    TCP/IP connections on port 5432?
lemur-web_1    | Attempt to connect to db.. try #2
lemur-web_1    |  ?column? 
lemur-web_1    | ----------
lemur-web_1    |         1
lemur-web_1    | (1 row)
lemur-web_1    | 
lemur-web_1    | db ready!
lemur-web_1    | 
lemur-web_1    | Creating lemurdb...
lemur-web_1    | CREATE DATABASE
lemur-web_1    | Creating the lemur user...
lemur-web_1    | CREATE ROLE
lemur-web_1    | Changing postgres password...
lemur-web_1    | GRANT
lemur-web_1    | Done changing postgres password...
lemur-web_1    | DONE CREATING lemurdb...
lemur-web_1    | Plugin 'ACMEIssuerPlugin' may not work correctly. Required variable 'ACME_DIRECTORY_URL' is not set in Lemur's conf.
lemur-web_1    | Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
lemur-web_1    | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
lemur-web_1    | INFO  [alembic.runtime.migration] Will assume transactional DDL.
lemur-web_1    | INFO  [alembic.runtime.migration] Running stamp_revision  -> 5e680529b666
lemur-web_1    | [+] Created 'admin' role
lemur-web_1    | [+] Created 'operator' role
lemur-web_1    | [+] Created 'read-only' role
lemur-web_1    | [+] Created the user 'lemur' and granted it the 'admin' role!
lemur-web_1    | [+] Creating expiration email notifications!
lemur-web_1    | [!] Using LEMUR_SECURITY_TEAM_EMAIL as specified by LEMUR_SECURITY_TEAM_EMAIL for notifications
lemur-web_1    | [!] Creating 3 notifications for 30,15,2 days as specified by LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS
lemur-web_1    | [/] Done!
lemur-web_1    | Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'ACMEIssuerPlugin' may not work correctly. Required variable 'ACME_DIRECTORY_URL' is not set in Lemur's conf.
lemur-web_1    | Traceback (most recent call last):
lemur-web_1    |   File "manage.py", line 538, in <module>
lemur-web_1    |     main()
lemur-web_1    |   File "manage.py", line 534, in main
lemur-web_1    |     manager.run()
lemur-web_1    |   File "/usr/local/src/lemur/venv/lib/python3.5/site-packages/flask_script/__init__.py", line 412, in run
lemur-web_1    |     result = self.handle(sys.argv[0], sys.argv[1:])
lemur-web_1    |   File "/usr/local/src/lemur/venv/lib/python3.5/site-packages/flask_script/__init__.py", line 383, in handle
lemur-web_1    |     res = handle(*args, **config)
lemur-web_1    |   File "/usr/local/src/lemur/venv/lib/python3.5/site-packages/flask_script/commands.py", line 216, in __call__
lemur-web_1    |     return self.run(*args, **kwargs)
lemur-web_1    |   File "manage.py", line 369, in run
lemur-web_1    |     validate_conf(current_app, REQUIRED_VARIABLES)
lemur-web_1    |   File "/usr/local/src/lemur/lemur/common/utils.py", line 102, in validate_conf
lemur-web_1    |     raise InvalidConfiguration("Required variable '{var}' is not set in Lemur's conf.".format(var=var))
lemur-web_1    | lemur.exceptions.InvalidConfiguration: Required variable 'LEMUR_SECURITY_TEAM_EMAIL' is not set in Lemur's conf.
lemur-web_1    | Waiting for db to become available
lemur-web_1    | Attempt to connect to db.. try #1
lemur-web_1    |  ?column? 
lemur-web_1    | ----------
lemur-web_1    |         1
lemur-web_1    | (1 row)
lemur-web_1    | 
lemur-web_1    | db ready!
lemur-web_1    | 
lemur-web_1    | Creating lemurdb...
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
lemur-web_1    | ERROR:  database "lemur" already exists
lemur-web_1    | Creating the lemur user...
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
lemur-web_1    | ERROR:  role "lemur" already exists
lemur-web_1    | Changing postgres password...
lemur-web_1    | GRANT
lemur-web_1    | Done changing postgres password...
lemur-web_1    | DONE CREATING lemurdb...
lemur-web_1    | Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'ACMEIssuerPlugin' may not work correctly. Required variable 'ACME_DIRECTORY_URL' is not set in Lemur's conf.
lemur-web_1    | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
lemur-web_1    | INFO  [alembic.runtime.migration] Will assume transactional DDL.
lemur-web_1    | [-] Admin role already created, skipping...!
lemur-web_1    | [-] Operator role already created, skipping...!
lemur-web_1    | [-] Operator role already created, skipping...!
lemur-web_1    | [-] Default user has already been created, skipping...!
lemur-web_1    | [+] Creating expiration email notifications!
lemur-web_1    | [!] Using LEMUR_SECURITY_TEAM_EMAIL as specified by LEMUR_SECURITY_TEAM_EMAIL for notifications
lemur-web_1    | [!] Creating 3 notifications for 30,15,2 days as specified by LEMUR_DEFAULT_EXPIRATION_NOTIFICATION_INTERVALS
lemur-web_1    | [/] Done!
lemur-web_1    | Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
lemur-web_1    | Plugin 'ACMEIssuerPlugin' may not work correctly. Required variable 'ACME_DIRECTORY_URL' is not set in Lemur's conf.
lemur-web_1    | Traceback (most recent call last):
lemur-web_1    |   File "manage.py", line 538, in <module>
lemur-web_1    |     main()
lemur-web_1    |   File "manage.py", line 534, in main
lemur-web_1    |     manager.run()
lemur-web_1    |   File "/usr/local/src/lemur/venv/lib/python3.5/site-packages/flask_script/__init__.py", line 412, in run
lemur-web_1    |     result = self.handle(sys.argv[0], sys.argv[1:])
lemur-web_1    |   File "/usr/local/src/lemur/venv/lib/python3.5/site-packages/flask_script/__init__.py", line 383, in handle
lemur-web_1    |     res = handle(*args, **config)
lemur-web_1    |   File "/usr/local/src/lemur/venv/lib/python3.5/site-packages/flask_script/commands.py", line 216, in __call__
lemur-web_1    |     return self.run(*args, **kwargs)
lemur-web_1    |   File "manage.py", line 369, in run
lemur-web_1    |     validate_conf(current_app, REQUIRED_VARIABLES)
lemur-web_1    |   File "/usr/local/src/lemur/lemur/common/utils.py", line 102, in validate_conf
lemur-web_1    |     raise InvalidConfiguration("Required variable '{var}' is not set in Lemur's conf.".format(var=var))
lemur-web_1    | lemur.exceptions.InvalidConfiguration: Required variable 'LEMUR_SECURITY_TEAM_EMAIL' is not set in Lemur's conf.
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';
postgres_1     | ERROR:  database "lemur" already exists
postgres_1     | STATEMENT:  CREATE DATABASE lemur;
postgres_1     | ERROR:  role "lemur" already exists
postgres_1     | STATEMENT:  CREATE USER lemur WITH PASSWORD 'lemur';

For some reason it gets stuck at creating the user and database.

mxk1235 commented 7 years ago

yep, i'm experiencing the same database/user create issue.

mxk1235 commented 7 years ago

i was able to get past this issue by setting the required variables just as they are defined in the tests https://github.com/Netflix/lemur/blob/cf6ad94509dfeb038416c76430162587ff58109c/lemur/tests/conf.py

bwhaley commented 7 years ago

Does it help if you docker-compose down to destroy everything, then docker-compose up to start anew?

kevgliss commented 7 years ago

Thanks, @mxk1235 I've pushed up a change to help with initial startup.