Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[o] ERROR: The server is not available. #93

Open
son1cn opened this issue Oct 9, 2021 · 23 comments
Open

[o] ERROR: The server is not available. #93

son1cn opened this issue Oct 9, 2021 · 23 comments

Comments

@son1cn
Copy link

son1cn commented Oct 9, 2021

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.

@WBWBW
Copy link

WBWBW commented Oct 25, 2021

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

@son1cn
Copy link
Author

son1cn commented Oct 26, 2021

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

@WBWBW
Copy link

WBWBW commented Oct 26, 2021

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

@jmwohl
Copy link
Member

jmwohl commented Oct 26, 2021

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
Copy link
Member

jmwohl commented Oct 26, 2021

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
Copy link
Member

jmwohl commented Oct 26, 2021

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"
  }

@son1cn
Copy link
Author

son1cn commented Oct 27, 2021

@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

@jmwohl
Copy link
Member

jmwohl commented Oct 27, 2021

@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.

@WBWBW
Copy link

WBWBW commented Nov 13, 2021

@jmwohl
Did installing from scratch solve it ?

@rayber
Copy link

rayber commented Jan 28, 2022

I tried installing from scratch and it did not work

@Stefterv
Copy link

Stefterv commented Feb 4, 2022

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

@WBWBW
Copy link

WBWBW commented Feb 5, 2022

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!

@rayber
Copy link

rayber commented Feb 8, 2022

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 &

@bimalnair
Copy link

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?

@jmwohl
Copy link
Member

jmwohl commented Feb 14, 2022

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!!

@RasmusNielsen
Copy link

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

@hannsQ
Copy link

hannsQ commented Jan 19, 2023

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 !!

@jmwohl
Copy link
Member

jmwohl commented Jan 19, 2023

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).

@hannsQ
Copy link

hannsQ commented Jan 20, 2023

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!!

@jmwohl
Copy link
Member

jmwohl commented Jan 23, 2023

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.

@hannsQ
Copy link

hannsQ commented Jan 24, 2023

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

@brookstalley
Copy link

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.

@calebcarpenter1995
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants