Open MLorneSmith opened 1 month ago
Hey there, @MLorneSmith! I'm here to help you with any bugs, questions, or contributions you might have. Let's tackle this together!
I found a similar issue regarding the error message "Fernet key must be 32 url-safe base64-encoded bytes" when trying to create a global variable in Langflow version 1.0.19 on Railway. To resolve this error, ensure that the SECRET_KEY
used in the get_fernet
function is properly formatted. You can use the add_padding
function to ensure the key is valid:
def add_padding(s):
padding_needed = 4 - len(s) % 4
return s + "=" * padding_needed
In the get_fernet
function, use this add_padding
function to ensure the SECRET_KEY
is valid:
def get_fernet(settings_service=Depends(get_settings_service)):
SECRET_KEY = settings_service.auth_settings.SECRET_KEY.get_secret_value()
padded_secret_key = add_padding(SECRET_KEY)
fernet = Fernet(padded_secret_key)
return fernet
Make sure the SECRET_KEY
is correctly set in your settings. If necessary, generate a new key using Fernet.generate_key()
and update your settings with this new key [1].
To continue talking to Dosu, mention @dosu.
News on this one?
Hi @lgertel, are you able to reproduce this issue on the newly released v1.1.0? https://pypi.org/project/langflow/
Yes! Running on 1.1.0 railway
@lgertel First time using railway, can you do me a favor and provide any Settings changes you made to build correctly?
Bug Description
After the one-click install of Langflow on Railway (latest version), I can't seem to create any global variables. Getting the following error: 'Error creating variable Fernet key must be 32 url-safe base64-encoded bytes'
Reproduction
Expected behavior
I expect to be able to create a variable
Who can help?
No response
Operating System
Railway environment
Langflow Version
1.0.19
Python Version
None
Screenshot
No response
Flow File
No response