Code Monkey home page Code Monkey logo

Comments (7)

brynn-code avatar brynn-code commented on August 20, 2024 2

Hi @IyobedZekarias , promptflow will create an encryption key to keyring when first use, the error raised seems because your local sqlite db has existing connections but encryption key not found in keyring, could you please try to delete the local db file (at ~/.promptflow/pf.sqlite) and have a next try?

from promptflow.

IyobedZekarias avatar IyobedZekarias commented on August 20, 2024

ok this ended up working but it creates a new pf.sqlite file whenever I create a new connection and I have to delete again

from promptflow.

brynn-code avatar brynn-code commented on August 20, 2024

The pf.sqlite is required to store connections, you don't need to care about it once it works. The db needs to be deleted before is because seems there are already connections inside it, but the required encryption key used to decrypt connection does not exist. Once the db got reset, encryption key will be re-created, and all things should go well. @IyobedZekarias

from promptflow.

github-actions avatar github-actions commented on August 20, 2024

Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!

from promptflow.

Gijs-Koot avatar Gijs-Koot commented on August 20, 2024

I run into exactly the same issue. After deleting the pf.sqlite file, I can set the correct keys once, but a next action will trigger the following exception

I'm using WSL as well, but not conda.

  File "/home/gijsk/projects/dshub-openai-scripts/.venv/lib/python3.11/site-packages/promptflow/_sdk/entities/_connection.py", line 187, in _from_orm_object_with_secrets
    obj = type_cls._from_orm_object_with_secrets(orm_object)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gijsk/projects/dshub-openai-scripts/.venv/lib/python3.11/site-packages/promptflow/_sdk/entities/_connection.py", line 270, in _from_orm_object_with_secrets
    obj.secrets = {k: decrypt_secret_value(obj.name, v) for k, v in obj.secrets.items()}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gijsk/projects/dshub-openai-scripts/.venv/lib/python3.11/site-packages/promptflow/_sdk/entities/_connection.py", line 270, in <dictcomp>
    obj.secrets = {k: decrypt_secret_value(obj.name, v) for k, v in obj.secrets.items()}
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gijsk/projects/dshub-openai-scripts/.venv/lib/python3.11/site-packages/promptflow/_sdk/_utilities/general_utils.py", line 164, in decrypt_secret_value
    raise Exception("Encryption key not found in keyring.")
Exception: Encryption key not found in keyring.

from promptflow.

Gijs-Koot avatar Gijs-Koot commented on August 20, 2024

I figured out a bit more about this issue. The problem is that keyring doesn't just work on WSL. See the section "Using Keyring on headless Linux systems" on https://pypi.org/project/keyring/. I didn't want to go into this solution involving dbus, and instead resorted to using a plaintext keyring implementation.

It would be nice if the package would support using a .env file as is common for other local development.

export PYTHON_KEYRING_BACKEND=keyrings.alt.file.PlaintextKeyring python

from promptflow.

brynn-code avatar brynn-code commented on August 20, 2024

@Gijs-Koot Thanks for your investigation. Promptflow is calling the keyring package during execution but not aware of which kind of keyring backend was using, I'm afraid we don't have a proper time to load the .env, also we need to consider about the prioritization of .env files in different folders. Thanks again for your time.

from promptflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.