flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.62k stars 455 forks source link

Could not connected to Flet server in 30 seconds. #2759

Open algotrading-py opened 9 months ago

algotrading-py commented 9 months ago

exact duplication of error #1359 /flet-dev/flet/issues/1359

Description

When trying to start any flet app with web browser view it hangs for 30 seconds and then fails with an exception: Exception: Could not connected to Flet server in 30 seconds.. Running the same app in desktop mode works fine.

Code example to reproduce the issue: `import flet as ft

def main(page: ft.Page): page.add(ft.Text(value="Hello, world!"))

ft.app(target=main, view=ft.WEB_BROWSER)`

I get an error:

Traceback (most recent call last): File "c:\My_prog\Flet\1.py", line 12, in ft.app(target=main, view=ft.WEB_BROWSER) File "c:\My_prog\Flet.venv\Lib\site-packages\flet_runtime\app.py", line 91, in app app_sync( File "c:\My_prog\Flet.venv\Lib\site-packages\flet_runtime\app.py", line 128, in __app_sync conn = connect_internal_sync( ^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\My_prog\Flet.venv\Lib\site-packages\flet_runtime\app.py", line 385, in __connect_internal_sync conn.connect() File "c:\My_prog\Flet.venv\Lib\site-packages\flet\sync_websocket_connection.py", line 63, in connect raise Exception( Exception: Could not connected to Flet server in 30 seconds.

This issue occurs when a config.ini file exists in the current working directory from which the app is started. app works fine after this file is deleted.

Logging:

INFO:flet_runtime:Assets path configured: C:\My_prog\Flet\assets INFO:flet_runtime:Starting local Flet Server on port 58168... INFO:flet_runtime:Flet Server found in: c:\My_prog\Flet.venv\Lib\site-packages\flet\bin\fletd.exe INFO:flet_runtime:Web renderer configured: canvaskit INFO:flet_runtime:Use color emoji: False INFO:flet_runtime:Route URL strategy configured: path DEBUG:flet_runtime:Creating new PubSubHub instance INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... panic: error reading config file: While parsing config: yaml: unmarshal errors: line 1: cannot unmarshal !!seq into map[string]interface {}

goroutine 1 [running]: github.com/flet-dev/flet/server/config.init.0() /home/appveyor/projects/flet/server/config/config.go:96 +0x733 ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws... ERROR:websocket:timed out - goodbye DEBUG:flet:Exited run_forever() INFO:flet:Reconnecting Flet Server in 0.1 seconds INFO:flet:Connecting Flet Server at ws://127.0.0.1:58168/ws...

devkam commented 5 months ago

I have the same issue, have you resolved it @algotrading-py? I tried to change the websocket's endpoint path, but it didn't help.