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 during startup - Failed to start FastAPI server on Win10 #637

Open
miro-ur opened this issue Nov 8, 2024 · 3 comments
Open

Error during startup - Failed to start FastAPI server on Win10 #637

miro-ur opened this issue Nov 8, 2024 · 3 comments
Assignees

Comments

@miro-ur
Copy link

miro-ur commented Nov 8, 2024

Overview

Installed v1.1.1 on Windows 10. Upon startup I'm getting the following error message:

image

Tried running the exe with administrator privilege's - same issue.
Looked for log files or some events in the windows event viewer that would provide additional details but could not find anything.

Let me know if you need more specific information to replicate/resolve.

@pdelboca
Copy link
Member

pdelboca commented Nov 21, 2024

Hello! Thanks for reporting.

Can you please provide the contents of your logger file? It will be located at the Home folder of the user installing the app: C:\Users\<yourusername>\.opendataeditor\logger\main.log

That would help us understand what's wrong.

Thanks!

@MitchellAcoustics
Copy link

Hi, I had the same issue on MacOS (M2). Initially, it showed the error saying it couldn't start the FastAPI server. I then ejected the disk image and tried again and it worked. I assume it was the restart, not ejecting the image that fixed it. So for others with the same issue, just try again and it might fix it.

For reference, here's the output of my log file showing the unsuccessful and successful startups:

[2024-11-26 15:09:07.603] [info]  # Start application
[2024-11-26 15:09:07.636] [info]  ## Start client
[2024-11-26 15:09:07.916] [info]  Opening loading.html
[2024-11-26 15:09:08.103] [info]  [FastAPI Server] Running backend server on port 4040
[2024-11-26 15:09:09.090] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:10.104] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:11.109] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:12.119] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:13.128] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:14.138] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:15.149] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:16.165] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:17.178] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:18.201] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:19.208] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:20.211] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:21.218] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:22.225] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:23.231] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:09:24.236] [error] [FastAPI Server] Server failed to start on http://127.0.0.1:4040 after 15 retries
[2024-11-26 15:09:24.239] [error] Error: Failed to start FastAPI server
    at createWindow (/Applications/Open Data Editor.app/Contents/Resources/app.asar/build/desktop/index.js:98:11)
    at async /Applications/Open Data Editor.app/Contents/Resources/app.asar/build/desktop/index.js:136:3
[2024-11-26 15:09:31.203] [info]  [FastAPI Server] { message: 'exiting child process on node exit' }
[2024-11-26 15:09:31.287] [error] [FastAPI Server stderr] INFO:     Started server process [19616]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:4040 (Press CTRL+C to quit)
INFO:     Shutting down
[2024-11-26 15:29:56.387] [info]  # Start application
[2024-11-26 15:29:56.420] [info]  ## Start client
[2024-11-26 15:29:56.718] [info]  Opening loading.html
[2024-11-26 15:29:56.908] [info]  [FastAPI Server] Running backend server on port 4040
[2024-11-26 15:29:57.252] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:29:58.266] [error] [FastAPI Server] Cannot access http://127.0.0.1:4040/health. Retrying...
[2024-11-26 15:29:58.273] [error] [FastAPI Server stderr] INFO:     Started server process [22726]
INFO:     Waiting for application startup.
[2024-11-26 15:29:58.277] [error] [FastAPI Server stderr] INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:4040 (Press CTRL+C to quit)
[2024-11-26 15:29:59.589] [info]  [FastAPI Server stdout] INFO:     127.0.0.1:64616 - "GET /health HTTP/1.1" 200 OK
[2024-11-26 15:29:59.597] [info]  [FastAPI Server] Server is running on http://127.0.0.1:4040
[2024-11-26 15:29:59.694] [info]  Opening index.html
[2024-11-26 15:30:09.742] [info]  [FastAPI Server stdout] INFO:     127.0.0.1:64629 - "POST /config/read HTTP/1.1" 200 OK
[2024-11-26 15:30:11.028] [info]  [FastAPI Server stdout] INFO:     127.0.0.1:64629 - "POST /file/list HTTP/1.1" 200 OK
[2024-11-26 15:30:21.061] [info]  [FastAPI Server stdout] INFO:     127.0.0.1:64635 - "POST /project/sync HTTP/1.1" 200 OK
[2024-11-26 15:30:31.064] [info]  [FastAPI Server stdout] INFO:     127.0.0.1:64641 - "POST /project/sync HTTP/1.1" 200 OK

@romicolman romicolman assigned roll and unassigned pdelboca Dec 16, 2024
@roll roll moved this from Backlog to In Progress in ODE: Stable Release Dec 18, 2024
@roll
Copy link
Collaborator

roll commented Dec 18, 2024

Hi @miro-ur,

can you please try with the latest release - https://github.com/okfn/opendataeditor/releases/tag/v1.2.0 - and share the log if the problem still exists?

@pdelboca
I don't see that it causes this issue but just for additional context - previously desktop used a open port finder to start the server. I don't see it in the current code so if 4040 is occupied the app will fail.

@roll roll moved this from In Progress to Blocked in ODE: Stable Release Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Blocked
Development

No branches or pull requests

4 participants