devika: [ISSUE] failed to connect to server
Once i get into de UI it popup a message saying “failed to connect server” and i cant continue, i can not interact in any way with the UI.
Configuration
- OS: windows
- Python version: 3.10.6
- Node version: 20.11
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 32
I found the fix. Go into Devika.py and change:
CORS(app, resources={r"/*": {"origins": ["https://localhost:3000"]}})toCORS(app)then start the server with: bun run dev --host
and go to the ip address starting in 192.168…
Hi everyone, late to the party but I had the same issue today when I was trying to set it up. The root cause seems to be the discrepancy between the port on which UI is started and the port used in CORS configuration in devika.py.
I suggest running
bun run startbefore running devika.py. After runningbun run start, it will print the local URL with the port number on which the UI is running. Update the CORS call in devika.py to have the same URL in origins as the one given by bun run start.Both the URLs in the picture should match.
I have another thought regarding this: If a port is being used by some other process,
bun run startwill start on a different port and you will need to update devika.py accordingly. This might explain why @TheMaskedAvengers and @thepwnshop had it working at one point and then it stopped working. However, I wasn’t able to test this behaviour. For me bun seems to overtake port 3001 even if another service is using it which is also odd. My expectation was that bun will just start on some other port.Cheers!
i have the same message with the localhost:3000 but its working good when i lunch with bun run dev --host and take 192.168… try it
with localhost
with local ip
worked for me.
Make sure to change line 29 of devika.py to your frontend URL.
CORS(app, resources={r"/*": {"origins": ["http://localhost:3001"]}}) # Change the origin to your frontend URLI had the same problem. Fixed it thanks to @Questscape.
In your
devika.pyfile, change theoriginsurl to your UI url ie. http://localhost:3001 (for me, no HTTPS but HTTP). After that I started devika up again it solved myCannot connect to serverissue.Also, it is not needed to run the UI with
--host, just usebun run startI’m having the same issue. It was working, and then all of the sudden, I’m getting this same error.
Hi all! I’ve the same problem. I’m using an Oracle Linux 9.3 virtual machine on Oracle VirtualBox.
Devika backend is up and running …
For the UI if I use
bun run startthe command output isand nothing appears in the browser.
If I use
bun run dev --hostthe command output isand the browser still return an empty page
Any suggestion will be appreciated!!
Thank you in advance
yeah !! thanks man, finally works with that command line when starting the UI.
If someone has the same issue, just start bun UI with the following line: “bun run dev --host” and then open the IP in your browser
same error