[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
I think you gotta use node version 18
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
same here...
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
same error
If you're using anything that would block a connections like portmaster then disable it
If you're using anything that would block a connections like portmaster then disable it
i disabled antivirus and windows brandmauer but no help...
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
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
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 start the command output is
and nothing appears in the browser.
If I use bun run dev --host the command output is
and the browser still return an empty page
Any suggestion will be appreciated!!
Thank you in advance
can you all share the browser's console? also try to run the python server with a different port and update it in api.js and run it again
Here you are the browser console ...
To set a different port for the backend, which file should I modify?
Weirdly I had this working, setup via pinokio, then stopped and restared it and now I'm getting the failed to connect to server error too. the localhost website loads...but when I go to settings all the API keys etc aren't visible there...
I'm having the same issue. It was working, and then all of the sudden, I'm getting this same error.
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 start before running devika.py. After running bun 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 start will 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!
@yuvneesh Thank you for the steps, but i have exactly the same
And still getting the same error
(It is not working from the start itself)
Try changing https to http in origins
Try changing https to http in origins
Tried just now, the issue remains same
same issue
I found the fix. Go into Devika.py and change:
CORS(app, resources={r"/*": {"origins": ["https://localhost:3000"]}})
to
CORS(app)
then start the server with: bun run dev --host
and go to the ip address starting in 192.168...
I tried this using docker-compose both on:
- Win 10
- Ubuntu Server 22.04
Also changed CORS to accept everything.
Same problem. Error Says HTTP 426 Upgrade required :/
UPDATE: I just tried to run it natively on the Ubuntu Server; only mapping ports to my Windows Machine through Putty. Same result. Kinda disappointing.
I had the same problem. Fixed it thanks to @Questscape.
In your devika.py file, change the origins url to your UI url ie. http://localhost:3001 (for me, no HTTPS but HTTP).
After that I started devika up again it solved my Cannot connect to server issue.
Also, it is not needed to run the UI with --host, just use bun run start
I had this same problem fixed by editing the devika.py file.
Make sure the port on which your origin urls is running on is the same port bun starts service.
In my case bun run the on port3001while in my devika.py, the port was set to 3000.
Change that and run bun run start. you are good to go..
All of that didn't work for me. I'm always getting 426 Upgrade Required by the HTTP Requests. As if for some reason it is routing the HTTP calls always to the SocketIO handler, despite the route for SocketIO is defined differently.
But funny that for some people little changes in the CORS URL and port or start command fixed it. For me all of this didn't work. I suspect it might be related to me being on windows.
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 URL
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 URL
Can we please get this added to the Readme steps? :-D
I 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 start
worked for me
I've tried everything above and still getting a CONNECTION_TIMED_OUT for 127.0.0.1:1337/api/data
Any other ideas?
fail... 127.0.0.1:1337/api/data both docker and venv
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...
worked for me.
The front end and backend are being prevented from communicating by CORS. You have to edit this file (server file) using notepad.exe C:\WINDOWS\System32\devika\ui\src\lib\api.js from the shell as you won't have permission to edit it from notepad directly.
find this code segment:
headers: { "Content-Type": "application/json", },
and change it to
headers: { 'Access-Control-Allow-Origin': '*', "Content-Type": "application/json", },
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...worked for me.
Thank you this one is working. Windows 11, python: 3.11



