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

Docker - OPENAI_API_KEY environment variable is missing or empty #139

Closed
AceDenghar opened this issue Jan 5, 2025 · 7 comments
Closed

Comments

@AceDenghar
Copy link

Hi,

Running tianji for a while without any problem (it's a great tool, thnaks !), i'm now facing this issue (logs) :

> cd src/server && cross-env NODE_ENV=production node ./dist/src/server/main.js
file:///app/tianji/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/index.mjs:42
            throw new Errors.OpenAIError("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an
apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");
                  ^
OpenAIError: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenA
I({ apiKey: 'My API Key' }).
    at new OpenAI (file:///app/tianji/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/openai/index.mjs:42:19)
    at file:///app/tianji/src/server/dist/src/server/model/openai.js:3:29
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)
Node.js v20.18.1
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

I don't know what to do....

Thanks for all

@infocillasas
Copy link

Hi,
Same here. tianji container reloading endlessly...

@GabrielRozendo
Copy link

GabrielRozendo commented Jan 8, 2025

seems it was added something related to Open AI in latest version 1.17.6

even setting ALLOW_OPENAI to false still requires the environment OPENAI_API_KEY

Added with a random value and worked!
CleanShot 2025-01-08 at 19 19 39@2x

You can even use a real API_KEY if you want (I'm not sure what is about and how tianji would use open AI)

@AceDenghar
Copy link
Author

Oh yes ! It's working using this environment variable !

Thank you very much ! 👍

@infocillasas
Copy link

Working, thanks a lot

@moonrailgun
Copy link
Contributor

Sorry for not noticing this issue so late, I will release a hotfix image to fix this issue soon.

@moonrailgun
Copy link
Contributor

v1.17.7 has been released and i think this issue has been fixed.
feel free to reopen it if you face same issue

@infocillasas
Copy link

v1.17.7 has been released and i think this issue has been fixed. feel free to reopen it if you face same issue

Yes it works perfectly, even without any defined OPENAI_API_KEY.
Thanks

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