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

cryptography.fernet.InvalidToken on docker compose restart #4806

Open
fastchain opened this issue Mar 30, 2024 · 0 comments
Open

cryptography.fernet.InvalidToken on docker compose restart #4806

fastchain opened this issue Mar 30, 2024 · 0 comments

Comments

@fastchain
Copy link

Hello,

I set

LEMUR_TOKEN_SECRET="aaa"

in .lemur.env

But after restart of the docker compose and login, I can't see certificates in GUI and I see this in compose logs :

lemur-1     |  LIMIT %(param_1)s OFFSET %(param_2)s
lemur-1     | 2024-03-30 14:19:48,689 INFO sqlalchemy.engine.base.Engine {'not_after_1': datetime.datetime(2024, 2, 29, 0, 0), 'param_1': 10, 'param_2': 0}
lemur-1     | [2024-03-30 14:19:48,689] ERROR in utils: Error decrypting token: b'gAAAAABmCB82T6BJMjVZgMAkBRtJGCLtk4iUocAMFOtKe3E4wz9lpwA7YK9PYjjP8De4dOdeQR6f8OdhC_Iy5S8pCINVkNdH1J9ySICKMqvCrFPyc2BzHakpIqCvwsn0lp14I4dAPtPTB2XvjWYNDH46mMS2JOAD__ct9CKf9_In7L105zJFkC5kvfezwdweLn0HPqpbC0V5AGVsbg8OKLy6TKfEyFUaat3znNEXr-4vqabeFrmbUtXacmibGgiTB1csRNNPmnKH1xeGuE6aFdrXvR3fHKKHvQcOGRRrRJqvIPyUE-SW7TxZmCeQ2lisq0kH0T4WbQwXSzDQ7539cHMDT0DiYNw7GxhHcfhErUWpi8VLUg7yj2j_1SVVPBsYKy3ReoNdhmNS'
lemur-1     | Error decrypting token: b'gAAAAABmCB82T6BJMjVZgMAkBRtJGCLtk4iUocAMFOtKe3E4wz9lpwA7YK9PYjjP8De4dOdeQR6f8OdhC_Iy5S8pCINVkNdH1J9ySICKMqvCrFPyc2BzHakpIqCvwsn0lp14I4dAPtPTB2XvjWYNDH46mMS2JOAD__ct9CKf9_In7L105zJFkC5kvfezwdweLn0HPqpbC0V5AGVsbg8OKLy6TKfEyFUaat3znNEXr-4vqabeFrmbUtXacmibGgiTB1csRNNPmnKH1xeGuE6aFdrXvR3fHKKHvQcOGRRrRJqvIPyUE-SW7TxZmCeQ2lisq0kH0T4WbQwXSzDQ7539cHMDT0DiYNw7GxhHcfhErUWpi8VLUg7yj2j_1SVVPBsYKy3ReoNdhmNS'
lemur-1     | Error decrypting token: b'gAAAAABmCB82T6BJMjVZgMAkBRtJGCLtk4iUocAMFOtKe3E4wz9lpwA7YK9PYjjP8De4dOdeQR6f8OdhC_Iy5S8pCINVkNdH1J9ySICKMqvCrFPyc2BzHakpIqCvwsn0lp14I4dAPtPTB2XvjWYNDH46mMS2JOAD__ct9CKf9_In7L105zJFkC5kvfezwdweLn0HPqpbC0V5AGVsbg8OKLy6TKfEyFUaat3znNEXr-4vqabeFrmbUtXacmibGgiTB1csRNNPmnKH1xeGuE6aFdrXvR3fHKKHvQcOGRRrRJqvIPyUE-SW7TxZmCeQ2lisq0kH0T4WbQwXSzDQ7539cHMDT0DiYNw7GxhHcfhErUWpi8VLUg7yj2j_1SVVPBsYKy3ReoNdhmNS'
lemur-1     | [2024-03-30 14:19:48,690] ERROR in schema: 
lemur-1     | Traceback (most recent call last):
lemur-1     |   File "/opt/lemur/lemur/common/schema.py", line 158, in decorated_function
lemur-1     |     resp = f(*args, **kwargs)
lemur-1     |   File "/opt/lemur/lemur/certificates/views.py", line 388, in get
lemur-1     |     return service.render(args)
lemur-1     |   File "/opt/lemur/lemur/certificates/service.py", line 697, in render
lemur-1     |     result = database.sort_and_page(query, Certificate, args)
lemur-1     |   File "/opt/lemur/lemur/database.py", line 339, in sort_and_page
lemur-1     |     items = query.offset(count * page).limit(count).all()
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3373, in all
lemur-1     |     return list(self)
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", line 100, in instances
lemur-1     |     cursor.close()
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
lemur-1     |     compat.raise_(
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
lemur-1     |     raise exception
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", line 80, in instances
lemur-1     |     rows = [proc(row) for row in fetch]
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", line 80, in <listcomp>
lemur-1     |     rows = [proc(row) for row in fetch]
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", line 579, in _instance
lemur-1     |     _populate_full(
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/orm/loading.py", line 725, in _populate_full
lemur-1     |     dict_[key] = getter(row)
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/sqlalchemy/sql/type_api.py", line 1278, in process
lemur-1     |     return process_value(impl_processor(value), dialect)
lemur-1     |   File "/opt/lemur/lemur/utils.py", line 124, in process_result_value
lemur-1     |     return MultiFernet(self.keys).decrypt(value).decode("utf8")
lemur-1     |   File "/opt/venv/lib/python3.8/site-packages/cryptography/fernet.py", line 205, in decrypt
lemur-1     |     raise InvalidToken
lemur-1     | cryptography.fernet.InvalidToken
lemur-1     | 

What am I doing wrong?

Thank you.

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

1 participant