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

Lemur Pod in K8s crashing #44

Open
ncpe20012003 opened this issue Jan 30, 2020 · 1 comment
Open

Lemur Pod in K8s crashing #44

ncpe20012003 opened this issue Jan 30, 2020 · 1 comment

Comments

@ncpe20012003
Copy link

Here are the logs:
Waiting for db to become available
Attempt to connect to db.. try #1
?column?

    1

(1 row)

db ready!

Creating lemurdb...
ERROR: database "lemur" already exists
Creating the lemur user...
ERROR: role "lemur" already exists
Changing postgres password...
GRANT
Done changing postgres password...
ALTER ROLE
DONE CREATING lemurdb...
/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_sqlalchemy/init.py:814: UserWarning: Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:".
'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. '
[2020-01-30 05:25:52,564] WARNING in managers: Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
[2020-01-30 05:25:52,564] WARNING in managers: Plugin 'DigiCertCISSourcePlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
Plugin 'DigiCertCISSourcePlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
[2020-01-30 05:25:52,564] WARNING in managers: Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
Traceback (most recent call last):
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context
cursor, statement, parameters, context
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 581, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: near "EXTENSION": syntax error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 591, in
main()
File "manage.py", line 587, in main
manager.run()
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_script/init.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_script/init.py", line 386, in handle
res = handle(*args, **config)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_script/commands.py", line 216, in call
return self.run(*args, **kwargs)
File "manage.py", line 198, in run
create()
File "manage.py", line 148, in create
database.db.engine.execute(text("CREATE EXTENSION IF NOT EXISTS pg_trgm"))
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2182, in execute
return connection.execute(statement, *multiparams, **params)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 982, in execute
return meth(self, multiparams, params)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1101, in _execute_clauseelement
distilled_params,
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1250, in _execute_context
e, statement, parameters, cursor, context
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
raise value.with_traceback(tb)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context
cursor, statement, parameters, context
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 581, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "EXTENSION": syntax error
[SQL: CREATE EXTENSION IF NOT EXISTS pg_trgm]
(Background on this error at: http://sqlalche.me/e/e3q8)
/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_sqlalchemy/init.py:814: UserWarning: Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:".
'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. '
[2020-01-30 05:25:55,086] WARNING in managers: Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
Plugin 'DigiCertCISIssuerPlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
[2020-01-30 05:25:55,086] WARNING in managers: Plugin 'DigiCertCISSourcePlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
Plugin 'DigiCertCISSourcePlugin' may not work correctly. Required variable 'DIGICERT_CIS_API_KEY' is not set in Lemur's conf.
[2020-01-30 05:25:55,086] WARNING in managers: Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
Plugin 'DigiCertIssuerPlugin' may not work correctly. Required variable 'DIGICERT_API_KEY' is not set in Lemur's conf.
Traceback (most recent call last):
File "manage.py", line 591, in
main()
File "manage.py", line 587, in main
manager.run()
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_script/init.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_script/init.py", line 386, in handle
res = handle(*args, **config)
File "/usr/local/src/lemur/venv/lib/python3.6/site-packages/flask_script/commands.py", line 216, in call
return self.run(*args, **kwargs)
File "manage.py", line 425, in run
validate_conf(current_app, REQUIRED_VARIABLES)
File "/usr/local/src/lemur/lemur/common/utils.py", line 241, in validate_conf
"Required variable '{var}' is not set in Lemur's conf.".format(var=var)
lemur.exceptions.InvalidConfiguration: Required variable 'LEMUR_SECURITY_TEAM_EMAIL' is not set in Lemur's conf.

What am I missing?

@mkrelle
Copy link

mkrelle commented Feb 7, 2020

Not a fix, but for comparison; under the environment below, build progresses without the SQLALCHEMY errors and successfully runs.

CentOS Linux release 7.7.1908
docker version 19.03.5, build 633a0ea
docker-compose version 1.25.4, build unknown
Modified /web/Dockerfile as per #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants