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

Backend fails and frontend keeps restarting and NetworkError #326

Open
da03 opened this issue Jun 30, 2024 · 1 comment
Open

Backend fails and frontend keeps restarting and NetworkError #326

da03 opened this issue Jun 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@da03
Copy link

da03 commented Jun 30, 2024

What is the issue?

Following the instructions of running from source (using make first-run), backend fails and frontend keeps restarting.

Issue 1

The log in the backend shows:

{"log":"usage: gunicorn [OPTIONS] [APP_MODULE]\r\n","stream":"stdout","time":"2024-06-30T17:46:32.725141827Z"}
{"log":"gunicorn: error: unrecognized arguments: --host 0.0.0.0 --port 8000\r\n","stream":"stdout","time":"2024-06-30T17:46:32.72521952Z"}
{"log":"usage: gunicorn [OPTIONS] [APP_MODULE]\r\n","stream":"stdout","time":"2024-06-30T17:47:26.680371566Z"}
{"log":"gunicorn: error: unrecognized arguments: --host 0.0.0.0 --port 8000\r\n","stream":"stdout","time":"2024-06-30T17:47:26.680407197Z"}

Which seems to be because --host is passed to gunicorn here https://github.com/cohere-ai/cohere-toolkit/blob/main/src/backend/Dockerfile#L54

The frontend log shows:

> @cohere-ai/[email protected] start
> next start

   ▲ Next.js 14.1.1
   - Local:        http://localhost:3000

Next.js environment variables: {
  NEXT_PUBLIC_API_HOSTNAME: 'http://localhost:8000',
  NEXT_PUBLIC_FRONTEND_HOSTNAME: 'http://localhost:4000',
  NEXT_PUBLIC_HAS_CUSTOM_LOGO: 'false'
}
[Error: ENOENT: no such file or directory, open '/app/.next/BUILD_ID'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/app/.next/BUILD_ID'
}

Issue 2

These issues seem to be caused by @rodrigue-h's most recent commit #ff80f21, so I reverted that commit and now frontend and backend are both running. However, when entering a message (using cohere), there's an error message "NetworkError when attempting to fetch resource".

Issue 3

Now I decide to give up and directly use docker run -e COHERE_API_KEY='my_cohere_api_key' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest, but same error message "NetworkError when attempting to fetch resource". When I look at console logs in my browser, it seems to be caused by CORS errors. Not sure if this is related to #106.

@da03 da03 added the bug Something isn't working label Jun 30, 2024
@tianjing-li
Copy link
Collaborator

@da03 were you able to retry with main? We changed our setup recently, you should be able to generate some config yaml files, then run make dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants