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

SWAG + v5 - "Read error (Connection reset by peer) in headers" #620

Open
andrew-cullen opened this issue Oct 13, 2024 · 0 comments
Open

Comments

@andrew-cullen
Copy link

andrew-cullen commented Oct 13, 2024

Setup information

docker-compose.yml

services:
swag:
image: lscr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
- URL=
- SUBDOMAINS=wildcard
volumes:
- ../swag:/config
ports:
- 8443:443
- 8880:80
restart: unless-stopped
networks:
selfhosted:
ipv4_address: 172.20.0.2

.....

Invoice_Ninja:
container_name: invoiceninja-v5
image: invoiceninja/invoiceninja:5
env_file: ../invoiceninja/env
restart: always
volumes:
- ../invoiceninja/config/hosts:/etc/hosts:ro
- ../invoiceninja/docker/app/public:/var/www/app/public:rw,delegated
- ../invoiceninja/docker/app/storage:/var/www/app/storage:rw,delegated
- ../invoiceninja/config/php/php.ini:/usr/local/etc/php/php.ini
- ../invoiceninja/config/php/php-cli.ini:/usr/local/etc/php/php-cli.ini

depends_on:
  - Invoice_Ninja_db
networks:
    selfhosted:
      ipv4_address: 172.20.0.3

Invoice_Ninja_db:
container_name: ininja_db
image: mysql:8
restart: always
env_file: ../invoiceninja/env
volumes:
- ../invoiceninja/docker/mysql/data:/var/lib/mysql:rw,delegated

networks:
    selfhosted:
      ipv4_address: 172.20.0.4 

Env

IN application vars

APP_URL=https://
APP_KEY=base64:....
APP_DEBUG=true
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'

QUEUE_CONNECTION=database

DB connection

DB_HOST=ininja_db
DB_PORT=3306
DB_DATABASE=A
DB_USERNAME=B
DB_PASSWORD=C
DB_DATABASE1=A
DB_USERNAME1=B
DB_PASSWORD1=C

MySQL

MYSQL_ROOT_PASSWORD=D
MYSQL_USER=E
MYSQL_PASSWORD=F
MYSQL_DATABASE=G

GoCardless/Nordigen API key for banking integration

NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=

Swag Config

server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;

server_name ininja.*;

include /config/nginx/ssl.conf;

client_max_body_size 0;

location / {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app invoiceninja-v5;
    set $upstream_port 80;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    proxy_set_header Range $http_range;
    proxy_set_header If-Range $http_if_range;
}

}

Steps taken upon setup

chmod 755 docker/app/public
sudo chown -R 1500:1500 docker/app
Modify ./config/hosts

Describe the bug

  • 502 gateway through swag.
  • wget -O - 172.20.0.3:9000 > /dev/null returns HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
  • With docker compose exec Invoice_Ninja sh
    netstat -tunlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.11:41999 0.0.0.0:* LISTEN - tcp 0 0 :::9000 :::* LISTEN 55/php-fpm.conf) udp 0 0 127.0.0.11:58564 0.0.0.0:* - ~ $ curl http://127.0.0.1:9000 curl: (56) Recv failure: Connection reset by peer

To reproduce
See above

Expected behavior
Ability to access webserver.

Screenshots/logs
Only noteable lines in logs appear to be
2024-10-13 05:15:25,025 WARN For [program:php-fpm], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored 2024-10-13 05:15:25,025 WARN For [program:scheduler], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored 2024-10-13 05:15:25,025 WARN For [program:queue-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored 2024-10-13 05:15:25,025 WARN For [program:queue-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored

Docker/Kubernetes/Helm:
Running docker 27.1.1

Any feedback as to where I might be able to look next to chase this down would be appreciated. I assume the error is upstream of Swag, as I'm unable to access :9000 from within the InvoiceNinja container, but I may well be missing something obvious here.

Thanks in advance, and apologies for the formatting.

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

1 participant