iGotify-Notification-Assistent icon indicating copy to clipboard operation
iGotify-Notification-Assistent copied to clipboard

[BUG] Failed connection Websocket

Open HoroshoVse opened this issue 1 year ago • 1 comments

Describe the bug info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8080 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s.

Expected behavior Error when starting a container

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version of Container [e.g. 1.0.0.7]
  • Version of iGotify [e.g. 1.0.5]

Additional context Add any other context about the problem here.

HoroshoVse avatar Sep 27 '24 20:09 HoroshoVse

How did configure the container (docker compose with local environment or over the app)

Is the gotify container in you're network available and from the igotify container?

androidseb25 avatar Sep 29 '24 15:09 androidseb25

Is this error still actually?

When no this Issue will be closed on day 30.

androidseb25 avatar Oct 14 '24 16:10 androidseb25

I also have the problem that I get this error message in the iGotify container.

I am using the Docker Compose template from Github. I have changed the port mapping and the bind of the folders.

Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Gotify Server is not available try to reconnect in 10s. Reconnecting...

Even if I don't apply any changes to the template, the error persists.

Docker is installed on an Intel Nuc on a Ubuntu server. The traffic goes through an NPM.

Guezli avatar Oct 17 '24 06:10 Guezli

did you have enabled Websocket support on NPM?

androidseb25 avatar Oct 17 '24 07:10 androidseb25

I also get this error. Websockets support is enabled

UPDATE: Ah never mind, it was an issue with the DNS on the server where both docker containers running. It's fine now.

paractmol avatar Nov 11 '24 19:11 paractmol

I have a question.

I'm using the latest version of iGotify: v1.5.0.1.

Below is my docker-compose.yaml file, which includes both Gotify and iGotify.

In the iGotify log file, I keep seeing the following message:

Database is created: True
Gotify Server: 'https://gotify' is not available, try to reconnect in 10s.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /app
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the HTTPS port for redirect.
Reconnecting...
Gotify Server: 'https://gotify' is not available, try to reconnect in 10s.

n my docker-compose file, I’ve tried different environment settings like:

  • GOTIFY_SERVERS=http://gotify:80 and
  • GOTIFY_URLS=http://gotify:80

But iGotify still tries to reach Gotify using https://gotify, not http://gotify:80. Even when I set the FQDN in GOTIFY_URL, the error still refers to https://gotify.

I tried using the FQDN because Traefik is running as a reverse proxy and automatically redirects all HTTP requests to HTTPS.

Both Gotify and iGotify are running in the same Docker stack. Do I need to run iGotify in a separate Docker environment?

The iPhone app works fine—I can view messages from Gotify—but I don’t receive notifications from iGotify. That makes sense, because iGotify can’t reach Gotify to read messages.

NOTE:

If I leave any of the following environment variables empty:

GOTIFY_URLS

GOTIFY_CLIENT_TOKENS

SECNTFY_TOKENS

Then I get this message in the iGotify log:

Database is created: True
Gotify Url list is: empty
Gotify Client list is: empty
SecNtfy Token list is: empty
If one or more lists are empty please check the environment variable! GOTIFY_SERVERS or GOTIFY_CLIENTS or NTFY_TOKENS
If all lists are empty, do nothing—you will configure the Gotify server via the iGotify app.
Gotify Server: 'https://gotify' is not available, try to reconnect in 10s.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /app
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the HTTPS port for redirect.

What could be causing this issue?

Jan-Kruis avatar Sep 16 '25 13:09 Jan-Kruis

@Jan-Kruis what do you u want to configure a local instance or a live instance where both gotify & igotify available in the internet?

androidseb25 avatar Sep 16 '25 17:09 androidseb25

Hi Sebastion,

I don’t quite understand your question about whether I want to configure a local or live instance.

mine gotify.domain.org is publicly accessible via the internet. My Traefik setup acts as a reverse proxy, handling traffic from the internet to internal Docker apps.

Here’s my problem: No matter what I set under the GOTIFY_URLS environment variable, it seems that iGotify replaces it with https://gotify, even though Gotify is listening on port 80 — in other words, over plain HTTP.

My question is: What do I need to change in the environment settings so that the connection to the Gotify service is made internally over port 80?

In short: I want iGotify to connect to http://gotify, not https://gotify.

Jan-Kruis avatar Sep 16 '25 18:09 Jan-Kruis

Ok, that's the way to make a local instance.

You need to configure everything over the app and you will get all necessary informations for the environments. Take a look at the screenshot and the example env below.

For you're Gotify URL you enter you're gotify.domain.org in the field

GOTIFY_URLS: 'http://192.168.178.199:8680'
GOTIFY_CLIENT_TOKENS: 'C1RXFpp_aHrmWyg'
SECNTFY_TOKENS: 'NTFY-DEVICE-hJGWiXsfAFC4nWJoNJksi9qKw23bcGAXAmNwqIaJlqh8V2mWdmHc27'
Image Image Image

androidseb25 avatar Sep 17 '25 07:09 androidseb25

Hi Sebastion,

I think there's a miscommunication about what exactly my problem is.

My problem isn't with the communication between the iGotify iPhone app and the GOTIFY Docker app, but between the iGOTIFY Docker app and the GOTIFY Docker services.

The connection between my iPhone and the GOTIFY app works fine. The iPhone is able to retrieve messages from the GOTIFY Docker services, but I'm not receiving any notifications from GOTIFY via iGOTIFY on my phone. I believe this is because the iGOTIFY services can't connect to the GOTIFY services, as shown in the log files I sent.

BTW I'm using the local instance on my iPhone and an HTTPS connection.

My problem is that the iGOTIFY Docker service can't communicate with the GOTIFY Docker service. Both services are running in a one stack. See my docker-compos.yaml file.

I think the problem is that iGOTIFY converts the various entries I enter in the GOTIFY_URLS to a sort of default value like https://gotify. Since the GOTIFY application only listens internally for http, iGOTIFY is unable to connect.

What could be causing iGOTIFY to constantly call the https server and the http version?

docker exec -it igotify sh -c "curl http://gotify:80/health"

{"health":"green","database":"green"}

docker exec -it igotify env | grep -E "GOTIFY|NTFY"

GOTIFY_URLS=http://gotify:80 GOTIFY_CLIENT_TOKENS=C8b............ SECNTFY_TOKENS=NTFY-DEVICE-u2h...............

docker logs igotify

Database is created: True Gotify Server: 'https://gotify' is not available try to reconnect in 10s. info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8080 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect. Reconnecting... Gotify Server: 'https://gotify' is not available try to reconnect in 10s. Reconnecting... Gotify Server: 'https://gotify' is not available try to reconnect in 10s. Reconnecting...

Jan-Kruis avatar Sep 17 '25 10:09 Jan-Kruis

can you take a look at you're users.db file in the data folder from iGotify in docker?

maybe there is a misconfigure and there stands https in it.

the users.db is a sqlite3 db

androidseb25 avatar Sep 18 '25 06:09 androidseb25

Hi Sebastion,

thanks by removing the user.db

this is now de igotufy log file

Database is created: True Gotify - Url: http://gotify:80 Is Gotify - Url available: yes SecNtfy Server - Url: https://api.secntfy.app Is SecNtfy Server - Url available: yes Client - Token: C8bRPRbvPtnRUK7 Client connecting... Done! info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8080 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect.

so it is working now

Jan-Kruis avatar Sep 18 '25 11:09 Jan-Kruis

perfect that it now work

androidseb25 avatar Sep 18 '25 12:09 androidseb25