cpmodel / FTT_StandAlone

Future Technology Transformation models
GNU General Public License v3.0
9 stars 1 forks source link

Model doesn't launch if port 5000 is unavailable #139

Open gressyde opened 1 month ago

gressyde commented 1 month ago

I have a Macbook Air with processor (1.6 GHz Dual-Core Intel Core i5) and MacOS Sonoma. However, when I try to process the model - it doesn't launch. What can be an issue?

[

Screenshot 2024-05-26 at 6 44 18 PM Screenshot 2024-05-26 at 6 44 25 PM

](url)

Terminal:

(base) Arina-Macbook-Air:~ vladelec$ cd '/Users/vladelec/Desktop/Exeter /Summer Project/FTT_StandAlone-main'
(base) Arina-Macbook-Air:FTT_StandAlone-main vladelec$ source .venv/bin/activate
(.venv) (base) Arina-Macbook-Air:FTT_StandAlone-main vladelec$ python3 Backend_FTT.py
Bottle v0.12.25 server starting up (using PasteServer())...
Listening on http://localhost:5020/

serving on http://127.0.0.1:5020
127.0.0.1 - - [26/May/2024:18:44:10 +0100] "GET /main HTTP/1.1" 304 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15"
127.0.0.1 - - [26/May/2024:18:44:12 +0100] "GET /frontend/cambridge_logo_light.png HTTP/1.1" 304 - "http://localhost:5020/main" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15"
127.0.0.1 - - [26/May/2024:18:44:12 +0100] "GET /frontend/model-Icon-FTT-126px_with_text_PV.png HTTP/1.1" 304 - "http://localhost:5020/main" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15"
127.0.0.1 - - [26/May/2024:18:44:12 +0100] "GET /frontend/front_background.png HTTP/1.1" 304 - "http://localhost:5020/main" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15"
127.0.0.1 - - [26/May/2024:18:44:12 +0100] "GET /apple-touch-icon-precomposed.png HTTP/1.1" 404 784 "-" "Safari/19618.2.12.11.6 CFNetwork/1496.0.7 Darwin/23.5.0"
127.0.0.1 - - [26/May/2024:18:44:12 +0100] "GET /apple-touch-icon.png HTTP/1.1" 404 760 "-" "Safari/19618.2.12.11.6 CFNetwork/1496.0.7 Darwin/23.5.0"
127.0.0.1 - - [26/May/2024:18:44:12 +0100] "GET /frontend/favicon-32x32.png HTTP/1.1" 200 605 "http://localhost:5020/main" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15"
127.0.0.1 - - [26/May/2024:18:44:13 +0100] "GET /frontend/ HTTP/1.1" 403 719 "http://localhost:5020/main" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15"
Femkemilene commented 1 month ago

I can reproduce this error on Windows. I cannot launch on localhost:5000 on my university laptop (Windows 11), but changing only the backend to use another port does not resolve the issues. I assume that another bit of the code assumes the 5000 port is used.

jp-camecon commented 1 month ago

Okay I see the issue, the backend is dynamically adjusting to another port but the frontend does not know the backend port has changed.

Will investigate a solution to generalise the frontend port setting to fix this issue

rhayward1 commented 4 weeks ago

You can fix this by turning off your AirPlay Receiver on Mac. You can do this with a simple switch in settings. AirPlay uses the 5000 port.

jp-camecon commented 4 weeks ago

Thanks Rosie. Interesting to know that apple uses the 5000 port for Airplay. I have discussed with Femke and for now we will update the dedicated port for the frontend to a new port 5020 to avoid this issue in general. As a much longer term option I will make the port number dynamic.