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

Error when /api/v1/settings/notifications is not found #2358

Closed
Flole998 opened this issue Jan 9, 2021 · 10 comments
Closed

Error when /api/v1/settings/notifications is not found #2358

Flole998 opened this issue Jan 9, 2021 · 10 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@Flole998
Copy link
Member

Flole998 commented Jan 9, 2021

This is an issue that is related to openhab/openhab-addons#12788. While the other issue covers unexpected behavior on the server this one is for unexpected behavior in the App.

When using a local openHAB Server the App requests /api/v1/settings/notifications, which is for myopenHAB and doesn't exist on a local installation. This causes the App to display a message at the bottom (. We should either remove this call (at least when contacting a local server) or silence the warning (at least when contacting a local server). I am not sure if it isn't trying to use my local server or if it is also trying to request this on a local server (which it shouldn't in my opinion). I would completely silence this warning for this URL as some might have the local server configured with the local address and the remote server configured with an external IP Address.

@Flole998 Flole998 added the bug Indicates an unexpected problem or unintended behavior label Jan 9, 2021
@maniac103
Copy link
Contributor

Did you enter the URL of your local server as 'remote server' in the app? The app will only do this request on the remote server.

@Flole998
Copy link
Member Author

Flole998 commented Jan 9, 2021

I entered a locally reachable URL for local server and a remotely reachable URL for the remote URL. It should be able to contact the local URL in my case, but seems like it doesn't.

Also I can't remove the remote URL anymore, if I empty the field it doesn't seem to save it.

@maniac103
Copy link
Contributor

Please post the app log after a connection attempt.

@Flole998
Copy link
Member Author

Flole998 commented Jan 9, 2021

Seems like it is actually using the local connection?

@Flole998
Copy link
Member Author

Flole998 commented Jan 9, 2021

To add to this: This is on the latest Beta available on Google play (2.15.15-beta), the latest Release (2.15.0) works perfectly fine.

@maniac103
Copy link
Contributor

maniac103 commented Jan 9, 2021

This log shows it's correctly using the local connection. If a remote connection is set, it's still correct the app tries to connect to the notification endpoint on the remote server in that case, since the app can't know whether the remote server is just an OH server or an openhab-cloud instance.

This causes the App to display a message at the bottom

What message are you referring to here?

@Flole998
Copy link
Member Author

Flole998 commented Jan 9, 2021

That shouldn't cause a visible error though.

It says something like "Not available, error while trying to connect to the server for remote connection: Not found (H...". The German version is "Nicht verfügbar, Fehler beim Verbinden mit dem Server für den Fernzugriff: Nicht gefunden (H...".

I guess it's this log entry:
Show snackbar with tag pushNotificationFail

@maniac103
Copy link
Contributor

Yes, that's right. We should remove the snackbar if the error was a 404.

@maniac103
Copy link
Contributor

maniac103 commented Jan 9, 2021

@mueller-ma On a semi related topic, I'm often getting this recently:
IMG_20210109_204754
Relevant log entry for that:

01-09 20:52:53.267 30957 31034 E Util    : REST call to  failed
01-09 20:52:53.267 30957 31034 E Util    : kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelled}@424bb37
01-09 20:52:53.268 30957 31034 D AbstractBaseActivity: Remove snackbar with tag pushNotificationFail from queue
01-09 20:52:53.268 30957 31034 D AbstractBaseActivity: Queue snackbar with tag pushNotificationFail

I assume it's two successive connection updates for whatever reason, where the second cancels the first one. We should exempt JobCancellationException from showing a snackbar as well, or probably not even update state from those exceptions in ConnectionFactory.

@mueller-ma
Copy link
Member

mueller-ma commented Jan 10, 2021

I see a couple of issues here and most of them have already been fixed, but we cannot release new versions to Play Store currently (working on it!) See openhab/openhab-core#2336

mueller-ma added a commit to mueller-ma/openhab.android that referenced this issue Jan 10, 2021
mueller-ma added a commit that referenced this issue Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants