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

Credentials could not be decrypted #643

Closed
prononext opened this issue Jul 29, 2023 · 7 comments
Closed

Credentials could not be decrypted #643

prononext opened this issue Jul 29, 2023 · 7 comments

Comments

@prononext
Copy link

Receiving following error when running a workflow with prior created credentials:


Error: Error: Error: Credentials could not be decrypted.
    at buildLangchain (/usr/local/lib/node_modules/flowise/dist/utils/index.js:230:19)
    at async App.processPrediction (/usr/local/lib/node_modules/flowise/dist/index.js:843:44)
    at async /usr/local/lib/node_modules/flowise/dist/index.js:559:13

Using Version 1.3.0 on docker with ENV PASSPHRASE and a 64 character random string

@prononext
Copy link
Author

I noticed when I delete the credentials it takes to attempts the first attempt gets following error:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at decryptCredentialData (/usr/local/lib/node_modules/flowise/dist/utils/index.js:804:39)
    at async /usr/local/lib/node_modules/flowise/dist/index.js:420:45

on the second attempt the credentials can be deleted.

When then recreating them they can be used.

BUT

When the service is restarted then the same error it happening again:

Receiving following error when running a workflow with prior created credentials:


Error: Error: Error: Credentials could not be decrypted.
    at buildLangchain (/usr/local/lib/node_modules/flowise/dist/utils/index.js:230:19)
    at async App.processPrediction (/usr/local/lib/node_modules/flowise/dist/index.js:843:44)
    at async /usr/local/lib/node_modules/flowise/dist/index.js:559:13

Using Version 1.3.0 on docker with ENV PASSPHRASE and a 64 character random string

@prononext
Copy link
Author

Also noticed the same problem with and without using the PASSPHRASE and when I want to edit a Credential its not opening and only this is showing:

image

@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Jul 29, 2023

Merged a fix - #641 and pushed to v1.3.1

Try upgrade to v1.3.1, and delete the previous credential, create a new one

Issue resolved - #640

@sebastien-prudhomme
Copy link

@HenryHengZJ is this really needed to generate a file containing the encryption key, as it seems it's build on the PASSPHRASE env variable? Keeping it in memory is not sufficient?

@prononext
Copy link
Author

@HenryHengZJ Ok just tried in 1.3.1 (by the way the Version on about did not change I just could verify over my docker service)

The same thing happens like here, but now the service craches afterwards:

Also noticed the same problem with and without using the PASSPHRASE and when I want to edit a Credential its not opening and only this is showing:

image

And also when recreating the credentials (with and without passphrase used as env. After the service gets reloaded they cannot be decrypted:


Error: Error: Error: Credentials could not be decrypted.
    at buildLangchain (/usr/local/lib/node_modules/flowise/dist/utils/index.js:230:19)
    at async App.processPrediction (/usr/local/lib/node_modules/flowise/dist/index.js:843:44)
    at async /usr/local/lib/node_modules/flowise/dist/index.js:559:13

@HenryHengZJ
Copy link
Contributor

@HenryHengZJ is this really needed to generate a file containing the encryption key, as it seems it's build on the PASSPHRASE env variable? Keeping it in memory is not sufficient?

the reason for having an encryption.key is to ensure the key is persistent, so you can decrypt/encrypt credentials, just like AWS KMS key.

@HenryHengZJ
Copy link
Contributor

@prononext i'd suggest delete all existing credentials you had there, and also make sure you have similar docker-compose.yml and .env file as here

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

4 participants