nextcloud / notify_push

Update notifications for nextcloud clients
GNU Affero General Public License v3.0
224 stars 40 forks source link

Error while communicating with nextcloud instance: error sending request #435

Closed Marcus1Pierce closed 4 months ago

Marcus1Pierce commented 4 months ago

I have issue with notify_push using manual setup in Nextcloud Docker. I run notify_push using docker-compose like this:

  nextcloud-notify-push:
    image: nextcloud:27-fpm
    container_name: nextcloud-notify-push
    restart: always
    user: www-data
    entrypoint: /var/www/html/custom_apps/notify_push/bin/aarch64/notify_push /var/www/html/config/config.php
    networks:
      - default
    ports:
      - 7867:7867
    depends_on:
      - nextcloud-postgres
      - nextcloud-postgres-snappymail
      - nextcloud-redis
    environment:
      - TZ=Asia/Jakarta
      - PORT=7867
      - NEXTCLOUD_URL=https://nextcloud.domain.tld
    volumes:
      - ${nextcloud}/server:/var/www/html
      - ${nextcloud}/nextcloud_data:/var/www/html/data

When i run php occ notify_push:setup https://nextcloud.domain.tld/push i have this error

βœ“ redis is configured
βœ“ push server is receiving redis messages
βœ“ push server can load mount info from database
πŸ—΄ can't connect to push server: cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nextcloud.domain.tld/push/test/reverse_cookie

When i open https://nextcloud.domain.tld/push/test/reverse_cookie result is error sending request for url (https://nextcloud.domain.tld/index.php/apps/notify_push/test/cookie): error trying to connect: tcp connect error: Connection refused (os error 111)

Logs on nextcloud-notify-push container

[2024-04-18 10:35:09.616274 +07:00] ERROR [notify_push] src/main.rs:78: Self test failed: Error while communicating with nextcloud instance: error sending request for url (https://nextcloud.domain.tld/index.php/apps/notify_push/test/version): error trying to connect: tcp connect error: Operation timed out (os error 110)
[2024-04-18 10:44:06.200837 +07:00] WARN [notify_push] src/lib.rs:281: Error while trying to get cookie from Nextcloud error sending request for url (https://nextcloud.domain.tld/index.php/apps/notify_push/test/cookie): error trying to connect: tcp connect error: Connection refused (os error 111)
[2024-04-18 11:05:59.223125 +07:00] WARN [notify_push] src/lib.rs:281: Error while trying to get cookie from Nextcloud error sending request for url (https://nextcloud.domain.tld/index.php/apps/notify_push/test/cookie): error trying to connect: tcp connect error: Connection refused (os error 111)

When i open https://nextcloud.domain.tld/index.php/apps/notify_push/test/version it just give me 1 | null

https://nextcloud.domain.tld/index.php/apps/notify_push/test/cookie give me 1 | 847648800

I use caddy for reverse proxy and i setup notify_push like this

nextcloud.domain.tld {
****
        handle_path /push/* {
                reverse_proxy http://192.168.100.11:7867
        }
****
}

I run this on: Raspberry Pi 4B Debian GNU/Linux 12 (bookworm) aarch64 Docker version 26.0.1, build d260a54 Nextcloud 27.1.8 Client Push 0.6.10

Marcus1Pierce commented 4 months ago

I manage it my self. Nextcloud and Notify Push container can't resolve my nextcloud.domain.tld so i edit my docker-compose to

  nextcloud-notify-push:
    image: nextcloud:27-fpm
    container_name: nextcloud-notify-push
    restart: always
    user: www-data
    entrypoint: /var/www/html/custom_apps/notify_push/bin/aarch64/notify_push /var/www/html/config/config.php
    networks:
      - default
    ports:
      - 7867:7867
    depends_on:
      - nextcloud-postgres
      - nextcloud-postgres-snappymail
      - nextcloud-redis
    environment:
      - TZ=Asia/Jakarta
      - PORT=7867
      - NEXTCLOUD_URL=https://nextcloud.domain.tld
    volumes:
      - ${nextcloud}/server:/var/www/html
      - ${nextcloud}/nextcloud_data:/var/www/html/data
    extra_hosts:
      - nextcloud.domain.tld:my.host.ip.address

Add extra_hosts make it work