sean-mcclure / defect_classifier

32 stars 35 forks source link

flask web is 404 error #1

Open winston11tw opened 4 years ago

winston11tw commented 4 years ago

When I input python api/app.py the code run successfully but the web is error 404 error How can I solve this problem?

sean-mcclure commented 4 years ago

Apologies, the Medium article was missing the instruction to start a web server. I have updated the Medium article here.

So you don't open the URL from Flask, you open the GUI contained in app/index.html.

Step 1: Start a web service by running in terminal:

python3 -m http.server

Step 2: Point your browser to:

http://localhost:8000/app/

The GUI will connect as needed.

winston11tw commented 4 years ago

Thanks. According to Medium article, now can open the web and FETCH BOARDS. But when I press RUN PIPELINE, the defect classfier will continue loading and result is not display. like this: error2 I have already move the export.pkl to /model Are there any step that I still missing ? Thanks for your help~

kedionai commented 4 years ago

Can you inspect your browser console (inspect element) to see if there are any errors?

winston11tw commented 4 years ago

@kedionai
error3 the CORS error

sean-mcclure commented 4 years ago

Hmm that's odd. I do not have the CORS issue, and it shouldn't happen with localhost since back-end and front-end are on same server. Which browser are you using? I know some people have had issues with Chrome browser and localhost when it comes to CORs, however I am using Chrome (Mac) with no issues.

winston11tw commented 4 years ago

I was using Firefox web browser which was default in Ubuntu. And the "python3 -m http.server" is run on the anaconda environment. Maybe I should install Chrome and try again. error4 Chrome still has the problem.

sean-mcclure commented 4 years ago

I think it's something with your environment. You might have to look into conda and/or Ubuntu issues with CORs. Since you are using Ubuntu, are you sure your browser is on the same machine as the server?

winston11tw commented 4 years ago

I check the web console again, and find the call_function's local host is 5000. 8002 Other function's local host is 8000. 7999 So I change the code in call_api.js, from "url": "http://localhost:5000/call_function/" to http://localhost:8000/call_function/ and try again. Now the CORS error is solved, but become the 404 error. 8000OK

kedionai commented 4 years ago

The call function is supposed to be 5000, since thats the endpoint port from Flask. It’s the CORS issue that needs to be resolved.

kedionai commented 4 years ago

Another option is I could add a Dockerfile, and see if you can access the application from outside a Docker container.

winston11tw commented 4 years ago

@kedionai
Can you try it? thanks~

sean-mcclure commented 4 years ago

The fastai doesnt seem to install properly using Docker. I'll let you know if I figure it out.

trucnguyen83 commented 3 years ago

image having these errors when clicking run pipeline. Have anyone solved the cors issue?

trucnguyen83 commented 3 years ago

Hi, I clone the latest version but got the GET http://localhost:8000/app/ 404 (File not found) error when viewing in browser.

I saw your config.js is az.hold_value.config = { api_url : "https://5000-violet-goose-u4jo2x0n.ws-us03.gitpod.io"}

Do we need to change this url to "http://localhost:5000"? I tried but still cannot work

kedionai commented 3 years ago

Yes you must change the URL in config.js to your own localhost and port; usually localhost:8000

Are you running api service from inside the api directory?

Sean McClure, Ph.D. Founder/CEO, Kedion Inc. kedion.ai 415-745-3688

On Mar 16, 2021, at 8:30 PM, trucnguyen83 @.***> wrote:

 Hi, I clone the latest version but got the GET http://localhost:8000/app/ 404 (File not found) error when viewing in browser.

I saw your config.js is az.hold_value.config = { api_url : "https://5000-violet-goose-u4jo2x0n.ws-us03.gitpod.io"}

Do we need to change this url to "http://localhost:5000"? I tried but still cannot work

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.