Openframe icon indicating copy to clipboard operation
Openframe copied to clipboard

[o] ERROR: The server is not available.

Open son1cn opened this issue 3 years ago • 23 comments

I've had Openframe running for a few months with no issue. A week or so ago it stopped initializing and I started looking into it today. When I run the open frame command, this comes up now:

[o] ERROR: The server is not available.

I tried to reinstall via the regular install script but no avail. I then reflashed raspbian and tried the script on a newly updated OS and still no dice. Openframe 0.4.12 and node 6.9.5.

npm list -g openframe
/home/pi/.nvm/versions/node/v6.9.5/lib
mqq [email protected]

Has anyone else experienced issue recently? I checked that the pi has access and can ping api.openframe.io with no issue.

son1cn avatar Oct 09 '21 06:10 son1cn

I have the same issue. Just came up after a reboot.

WBWBW avatar Oct 25 '21 15:10 WBWBW

@WBWBW Did you do anything besides reboot? I have rebuilt my whole RPi image, confirmed internet access and still no go

son1cn avatar Oct 26 '21 05:10 son1cn

No. It looks like it’s the same for everyone. May be the server is no longer maintained or an issue hasn’t been fixed. https://openframe.discourse.group/t/error-the-server-is-not-available/183/8

WBWBW avatar Oct 26 '21 05:10 WBWBW

Hey! Really sorry for the delay — the hosted Openframe server is loosely maintained as time allows! And sadly I haven't had time to look into this yet. The API server is running, otherwise the web app wouldn't load, so it seems as though there's some other issue that's blocking the frame controller from connecting :/. I'll try to find time to look into it ASAP.

jmwohl avatar Oct 26 '21 16:10 jmwohl

Did anyone try looking at the debug output? I think if you run DEBUG=* openframe when logging in you might get more detailed error info? Not certain, haven't tried it or looked at what debug info is present.

jmwohl avatar Oct 26 '21 16:10 jmwohl

Also check the config file at ~/.openframe/.ofrc — it's possible this has been corrupted. The "network" property should look like this if you're using the hosted Openframe server:

 "network": {
    "api_base": "https://api.openframe.io",
    "app_base": "https://openframe.io"
  }

jmwohl avatar Oct 26 '21 16:10 jmwohl

@jmwohl Here is the output with the DEBUG flag set:

pi@raspberrypi:~ $ DEBUG=* openframe
  openframe:config load +0ms
  openframe:frame load +17ms
  openframe:frame inflateStateFromFile +7ms
  openframe:user load +4ms
  superagent GET https://api.openframe.io/explorer/swagger.json +134ms


[o]   ERROR: The server is not available.


  openframe:cli Can't read from server.  It may not have the appropriate access-control-origin settings. +858ms

.ofrc currently:

pi@raspberrypi:~ $ cat ~/.openframe/.ofrc
{
  "network": {
    "api_base": "https://api.openframe.io",
    "app_base": "https://openframe.io"
  }
}

I can confirm that the pi can ping both api.openframe.io and openframe.io. I was even able to WGET the swagger.json that it tries to read before claiming the server is unavailable. Quite peculiar

son1cn avatar Oct 27 '21 01:10 son1cn

@son1cn Thanks for this! Strange indeed, but the CORS error might be a clue — it's possible that something changed on the server (not sure why that would be the case?) or some request-related JS dependency on the Pi that is blocking the request. I'll try to set up a fresh frame and debug further.

jmwohl avatar Oct 27 '21 15:10 jmwohl

@jmwohl Did installing from scratch solve it ?

WBWBW avatar Nov 13 '21 18:11 WBWBW

I tried installing from scratch and it did not work

rayber avatar Jan 28 '22 16:01 rayber

I installed a local cors proxy through npm and used that to successfully login:

npm install no-cors-proxy -g

no-cors-proxy -p 8000 -t https://api.openframe.io &

nano ~/.openframe/.ofrc

{
  "network": {
    "api_base": "http://localhost:8000",
    "app_base": "https://openframe.io"
  }
}

DEBUG=* openframe

Now I could login

Stefterv avatar Feb 04 '22 17:02 Stefterv

I installed a local cors proxy through npm and used that to successfully login:

npm install no-cors-proxy -g

no-cors-proxy -p 8000 -t https://api.openframe.io &

nano ~/.openframe/.ofrc

{
  "network": {
    "api_base": "http://localhost:8000",
    "app_base": "https://openframe.io"
  }
}

DEBUG=* openframe

Now I could login

Awesome! Do you know how to make the proxy persist after a reboot? Thanks for the help!

WBWBW avatar Feb 05 '22 07:02 WBWBW

You can add it in ~/.openframe/autoboot.sh and add the following line before the openframe line

nohup no-cors-proxy -p 8000 -t https://api.openframe.io & >/dev/null 2>&1 &

rayber avatar Feb 08 '22 00:02 rayber

Hi I followed the above instructions and I still get

ERROR : The server is not available

Openframe: cli Can't read from server. It may not have appropriate access-control-origin settings.

What can be done to solve this?

bimalnair avatar Feb 14 '22 06:02 bimalnair

The cause of this issue is the swagger-client dependency. For whatever reason, using this client to connect to the server no longer works. I haven't had a chance to look into it in detail, but one solution would be to replace the use of this package with a lower-level HTTP request package and make the API requests more manually, or perhaps swap in the openframe-jsclient and use that for API requests.

Contributions very welcome!!

jmwohl avatar Feb 14 '22 17:02 jmwohl

Excited for this project. Hope this can be kept alive.

RasmusNielsen avatar Sep 10 '22 16:09 RasmusNielsen

hello there :) ... seems that i ran into this problem also, fresh install of a rasberry pi 3, follwed the instructions to install openframe, bit i get this Error: The server is not available. this is the debug output:

setterm: terminal xterm does not support --blank setterm: cannot (un)set powersave mode: Unpassender IOCTL (I/O-Control) für das Gerät piop@raspberrypi:~ $ DEBUG=* openframe openframe:config load +0ms openframe:frame load +16ms openframe:frame inflateStateFromFile +6ms openframe:user load +4ms superagent GET https://api.openframe.io/explorer/swagger.json +107ms

[o] ERROR: The server is not available.

openframe:cli Can't read from server. It may not have the appropriate access-control-origin settings. +461ms

is there any solution for this ? thanks !!

hannsQ avatar Jan 19 '23 20:01 hannsQ

Hi @hannsQ — I haven't followed up on this, but I'm fairly certain the solution is replace the swagger-client dependency with simple fetch requests to the API (or maybe to use a different or updated swagger client).

jmwohl avatar Jan 19 '23 20:01 jmwohl

thank you jmwohl for your answer, i just dont know how to do that - where can i replace the swagger-client and with which kind of commad do i make this fetch request to the api?

Thank you !!

during installation of openframe following error occured:

E: Unable to locate package glslviewer npm ERR! Linux 5.15.84-v7+ npm ERR! argv "/home/pi/.nvm/versions/node/v6.9.5/bin/node" "/home/pi/.nvm/versi ons/node/v6.9.5/bin/npm" "install" "-g" "openframe-image@latest" npm ERR! node v6.9.5 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: ./install.sh npm ERR! Exit status 100 npm ERR! npm ERR! Failed at the [email protected] install script './install.sh'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the openframe-image packa ge, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ./install.sh npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs openframe-image npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls openframe-image npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log /home/pi/.nvm/versions/node/v6.9.5/bin/glslLoader -> /home/pi/.nvm/versions/node /v6.9.5/lib/node_modules/openframe-glslviewer/bin/glslLoader

[email protected] install /home/pi/.nvm/versions/node/v6.9.5/lib/node _modules/openframe-glslviewer ./install.sh

Installing glslViewer... ./install.sh: line 36: [: ==: unary operator expected Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package glslviewer npm ERR! Linux 5.15.84-v7+ npm ERR! argv "/home/pi/.nvm/versions/node/v6.9.5/bin/node" "/home/pi/.nvm/versi ons/node/v6.9.5/bin/npm" "install" "-g" "openframe-glslviewer@latest" npm ERR! node v6.9.5 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: ./install.sh npm ERR! Exit status 100 npm ERR! npm ERR! Failed at the [email protected] install script './install.sh'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the openframe-glslviewer package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ./install.sh npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs openframe-glslviewer npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls openframe-glslviewer npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log ... also starting npm with debug flag give this result:

pi@rasp:~ $ DEBUG=* npm start npm ERR! Linux 5.15.84-v7+ npm ERR! argv "/home/pi/.nvm/versions/node/v6.9.5/bin/node" "/home/pi/.nvm/versions/node/v6.9.5/bin/npm" "start" npm ERR! node v6.9.5 npm ERR! npm v3.10.10 npm ERR! path /home/pi/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json' npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log pi@rasp:~ $

thank you!!

hannsQ avatar Jan 20 '23 10:01 hannsQ

Regarding the swagger-client, it would basically be replacing the contents of this file:

https://github.com/OpenframeProject/Openframe/blob/master/src/rest.js

Then updating elsewhere in the app where the rest module is used.

The other error you're seeing there is unrelated, it seems like maybe glslViewer isn't available as a package in this linux distribution. We may need to go back to installing that manually.

jmwohl avatar Jan 23 '23 16:01 jmwohl

Thanks a lot jmwohl, seems this is beyond my ability.. i will wait for an update, hoping to get openframe running... :) tx

hannsQ avatar Jan 24 '23 12:01 hannsQ

I’ve been digging into this a bit… the root cause is the API server not setting the CORS headers, at least on swagger.json. I see that the server is using loopback, and the config has cors:false under remoting, but the loopback documentation suggests there should be a cors:{origin:false} entry under the rest options. This might be a change in loopback?

I haven’t yet set up a server to test, but figured I’d share.

brookstalley avatar Mar 11 '23 19:03 brookstalley

Is this project being maintained? This thread is from 2021 and this issue is a blocker for 100% of users and basically nullifies the entire project. It's a bad user experience to get all the way to this point in setup and to be blocked at the last step with no indication from the maintainers that it's broken (apart from issues in github).

Could you update the README or the documentation if this project is going to remain unmaintained and broken?

calebcarpenter1995 avatar Jan 11 '24 22:01 calebcarpenter1995