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

Error: using nextjs-with-flask-server app is showing error #159

Closed
patriksharma opened this issue Feb 25, 2023 · 18 comments
Closed

Error: using nextjs-with-flask-server app is showing error #159

patriksharma opened this issue Feb 25, 2023 · 18 comments
Assignees

Comments

@patriksharma
Copy link

I have installed the Server as per the readme file and run a client on the terminal.

the local host appeared and uploaded a doc, when trying to get an answer its displaying the below error.

ready - started server on 0.0.0.0:3000, url: http:https://localhost:3000
event - compiled client and server successfully in 1182 ms (166 modules)
wait  - compiling...
event - compiled successfully in 100 ms (133 modules)
wait  - compiling / (client and server)...
event - compiled client and server successfully in 521 ms (757 modules)


INFO:werkzeug: * Debugger PIN: 105-174-659
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:56:49] "POST /process_file HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:56:51] "OPTIONS /answer_question HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:56:54] "POST /answer_question HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:57:14] "POST /process_file HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:57:24] "OPTIONS /answer_question HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [25/Feb/2023 11:57:27] "POST /answer_question HTTP/1.1" 200 -

Screenshot 2023-02-25 at 11 57 53 AM

@Sassun
Copy link

Sassun commented Feb 25, 2023

I get a similar error when trying to get an answer from the successfully uploaded document.

image

@ismailntl
Copy link

ismailntl commented Mar 10, 2023

got this aswell;

Error is triggered only when i upload a second file and ask a question;
I can silence the error and get the system running by checking whether the parameters of the function existed; this results in unstable behavior

spent a short amount of time modifying the src/components/ files and made some changes which seemed to make an improvement but was unstable;

@Ayo-faks
Copy link

How did you get it to upload. Mine doesn't upload, it gives the error POST http:https://localhost:8080/process_file net::ERR_CONNECTION_REFUSED

@troublesprouter
Copy link

Mine doesn't upload either!

image

@isafulf
Copy link
Contributor

isafulf commented Mar 12, 2023

Hey @Ayo-faks and @troublesprouter are you running the server in a separate terminal tab, and did you add your own details to server/config.py? I also just pushed a change to the server initializing script that could help.

@faksonbaba
Copy link

same problem here. it just does not connect but the code seems correct. i even disabled my firewall but same problem. I wonder what it could be.

@Ayo-faks
Copy link

Ayo-faks commented Mar 13, 2023

Hey @Ayo-faks and @troublesprouter are you running the server in a separate terminal tab, and did you add your own details to server/config.py? I also just pushed a change to the server initializing script that could help.

Hello @isafulf , I still get the same error. Wonder why it's different for me. And yes, they are opened on different terminals.
Can you test it out on codespaces or gitpod, maybe there is a port forwarding issue.

thanks

@troublesprouter
Copy link

troublesprouter commented Mar 19, 2023

Hey @Ayo-faks and @troublesprouter are you running the server in a separate terminal tab, and did you add your own details to server/config.py? I also just pushed a change to the server initializing script that could help.

I tried Linux now. It now attempts uploading but fails with "error processing file: AxiosError: Request aborted" in the console.

Any ideas how to make it work?

Yes, terminals are different.

@troublesprouter
Copy link

Update: it worked on Linux. I don't know why.

@Ayo-faks
Copy link

Ayo-faks commented Mar 21, 2023

Update: it worked on Linux. I don't know why.

Are you running it locally on your system?
I have still not got it to work. any help, anyone!

@troublesprouter
Copy link

Update: it worked on Linux. I don't know why.

Are you running it locally on your system? I have still not got it to work. any help, anyone!

Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe.

Any advice on how to host it publicly with Vercel or something else? What's the simplest way?

I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made.

@WaughB
Copy link

WaughB commented Mar 21, 2023

I ran into this same problem, but I think it had to do with being rate limited. I was on the free trial and running too many requests per minute. I started waiting two-three minutes between questions and was able to get around this issue.

Related documentation: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_handle_rate_limits.ipynb

@faksonbaba
Copy link

Update: it worked on Linux. I don't know why.

Are you running it locally on your system? I have still not got it to work. any help, anyone!

Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe.

Any advice on how to host it publicly with Vercel or something else? What's the simplest way?

I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made.

My plan was to deploy the flask app as a container and then host the Nextjs app on vercel.

Do you remember the steps you took to make it work, what changed , where were you running it before? We have exactly the same problem.

@troublesprouter
Copy link

troublesprouter commented Mar 21, 2023 via email

@faksonbaba
Copy link

I tried mac without success. Don’t know the cause. I set an openai api key inside the yaml config file too. Not sure that was there before. Changed the start script command to python3 from python. Hope that helps. Is Vercel ok with both including flask or only with the nextjs part?

On Tue, 21 Mar 2023 at 16:28, faksonbaba @.> wrote: Update: it worked on Linux. I don't know why. Are you running it locally on your system? I have still not got it to work. any help, anyone! Yes, it ran locally. Try to find all places to add the API keys and use 3 terminal windows just to be safe. Any advice on how to host it publicly with Vercel or something else? What's the simplest way? I tried running vercel from the root directory but got a 404 error. Not sure what changes have to be made. My plan was to deploy the flask app as a container and then host the Nextjs app on vercel. Do you remember the steps you took to make it work, what changed , where were you running it before? We have exactly the same problem. — Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGDEVWUB5K7YQV7HXKTXO3W5HJJLANCNFSM6AAAAAAVHVPTQI . You are receiving this because you were mentioned.Message ID: @.>

For me it is easier to wrap my head around deploying it as a container.

I am almost giving up on this repo and @isafulf does not seem intrested

@troublesprouter
Copy link

troublesprouter commented Mar 21, 2023 via email

@ismailntl
Copy link

I get a similar error when trying to get an answer from the successfully uploaded document.

image

Im curious if anyone has gotten around this? When uploading larger document or more than one document it breaks here.

@trprichard
Copy link

Has anybody gotten this to work? I am trying to run this on Linux, but am getting an Axios ERR_CONNECTION_REFUSED when trying to upload a document. How do I get around this error? Also, @isafulf mentioned editing the server/config.py file with our own information. What needs to be edited in this file?

syusuke9999 pushed a commit to syusuke9999/openai-cookbook that referenced this issue May 12, 2023
Yruiz97 added a commit to Yruiz97/openai-cookbook that referenced this issue Sep 9, 2023
katia-openai pushed a commit that referenced this issue Feb 29, 2024
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

10 participants