Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

IOS unable to reach server #18

Closed
tlkhorses opened this issue Jan 12, 2018 · 12 comments
Closed

IOS unable to reach server #18

tlkhorses opened this issue Jan 12, 2018 · 12 comments

Comments

@tlkhorses
Copy link

We have an issue where iPhones get the message Unable to reach server. Software was just downloaded yesterday so is current. Android is working via app. The iPhones meet the requirements and are set up with tokens and proper url. They both can log in via browser. This happens both via wifi, cell on and off network.

@twelch24
Copy link

Also seeing this on previously working app setups. I've tried removing the app and settings and logging in again, still fails.

@pheinrichs
Copy link
Collaborator

pheinrichs commented Jan 12, 2018

Thanks for the notice, I'll look into this right away

@pheinrichs
Copy link
Collaborator

@tlkhorses @twelch24 Okay, this seems to be an issue with servers and cors not enabled. My apologies, on the new iOS update in ionic it enforces this and I have it enabled so I didn't notice this issue.
I will update the app next week with a native plugin to avoid this issue, as a temporary fix all you need to do is enable it on your servers for the app to work.

https://github.com/librenms/librenms/blob/master/doc/Support/Configuration.md#cors-support

@tlkhorses
Copy link
Author

Hi, I added the cors enabled to the config.php and didn't work. Added the whole section, restart and still no go.

@twelch24
Copy link

twelch24 commented Jan 12, 2018 via email

@tlkhorses
Copy link
Author

tlkhorses commented Jan 13, 2018 via email

@tlkhorses
Copy link
Author

He can reach it via browser on the phone. I checked global on the server and it shows enabled.

@laf
Copy link
Member

laf commented Jan 14, 2018

Check the web server logs. On one install of mine without cors I see:

192.168.80.31 - - [14/Jan/2018:21:52:56 +0000] "OPTIONS //api/v0 HTTP/1.0"

Also, get them to try a manual curl if they can using the token to see if it works:

curl -H 'X-Auth-Token: TOKEN' 'https://URL/api/v0

@pheinrichs
Copy link
Collaborator

1.2.1 push to apple store. Pending approval, with cors fix.

@tlkhorses
Copy link
Author

@laf where are the server logs? Only see /var/log/... stuff.
@pheinrichs would it make a difference what user level they are at? These two are Global Read where mine is administrator and happens to be the only Android.

@pheinrichs
Copy link
Collaborator

1.2.1 is available on iOS so you should be able to remove the cors config if you wish

@tlkhorses the server logs will be in your librenms directory I believe Default "/opt/librenms/logs/access_log"
Global read shouldn't be an issue also, I was able to test a user with similar permissions with no problems.

@tlkhorses
Copy link
Author

The update fixed the issue for us. Thanks.

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

No branches or pull requests

4 participants