Initial setup fails with 404 - Web UI sends API requests to wrong port #956

Closed
opened 2026-04-05 18:03:00 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @stlas on 9/5/2025

Bug Description

When attempting to create the initial server admin account through the Web UI, the request fails with a 404 error. The Web UI incorrectly sends API requests to port 8080 (Web UI port) instead of port 3000 (API port).

Steps to Reproduce

  1. Fresh installation of Pangolin (tested with v1.8.0 and latest)
  2. Start container with standard port mapping:
    • 3000:3000 (API)
    • 8080:3002 (Web UI)
  3. Navigate to http://server:8080
  4. Fill in initial setup form with email, password, and setup token
  5. Click "Create Admin Account"
  6. Observe 404 error

Expected Behavior

API request should go to http://server:3000/api/v1/auth/set-server-admin

Actual Behavior

API request goes to http://server:8080/api/v1/auth/set-server-admin (wrong port)

Environment

  • Pangolin Version: 1.8.0, 1.9.3, latest
  • Deployment: Docker (fosrl/pangolin)
  • OS: Debian 12
  • Browser: Chrome/Firefox (all affected)

Additional Context

  • Setup token is correctly generated in logs: Token: xmxfh6yjpyd95zx9so0qh3ed6y39tbam
  • Database shows token exists and is unused
  • Direct API calls to port 3000 fail with "CSRF token missing or invalid"
  • Network tab shows: PUT http://server:8080/api/v1/auth/set-server-admin 404 (Not Found)

Workaround Attempts

  1. ✗ Nginx reverse proxy - Still hits wrong port
  2. ✗ Direct API calls - Blocked by CSRF protection
  3. ✗ Different versions - All affected

Suggested Fix

The Next.js frontend should be configured to send API requests to the correct port (3000) or use relative URLs that get properly proxied.

Config Used

app:
  dashboard_url: "http://XXX.XXX.XXX.XXX:8080"
  log_level: "info"

server:
  external_port: 3000
  internal_port: 3001
  next_port: 3002
  secret: "secret-key-here"

domains:
  example:
    base_domain: "example.com"
    cert_resolver: "self-signed"

This makes initial setup impossible without modifying the deployment or using workarounds.

*Originally created by @stlas on 9/5/2025* ### Bug Description When attempting to create the initial server admin account through the Web UI, the request fails with a 404 error. The Web UI incorrectly sends API requests to port 8080 (Web UI port) instead of port 3000 (API port). ### Steps to Reproduce 1. Fresh installation of Pangolin (tested with v1.8.0 and latest) 2. Start container with standard port mapping: - 3000:3000 (API) - 8080:3002 (Web UI) 3. Navigate to `http://server:8080` 4. Fill in initial setup form with email, password, and setup token 5. Click "Create Admin Account" 6. Observe 404 error ### Expected Behavior API request should go to `http://server:3000/api/v1/auth/set-server-admin` ### Actual Behavior API request goes to `http://server:8080/api/v1/auth/set-server-admin` (wrong port) ### Environment - **Pangolin Version:** 1.8.0, 1.9.3, latest - **Deployment:** Docker (fosrl/pangolin) - **OS:** Debian 12 - **Browser:** Chrome/Firefox (all affected) ### Additional Context - Setup token is correctly generated in logs: `Token: xmxfh6yjpyd95zx9so0qh3ed6y39tbam` - Database shows token exists and is unused - Direct API calls to port 3000 fail with "CSRF token missing or invalid" - Network tab shows: `PUT http://server:8080/api/v1/auth/set-server-admin 404 (Not Found)` ### Workaround Attempts 1. ✗ Nginx reverse proxy - Still hits wrong port 2. ✗ Direct API calls - Blocked by CSRF protection 3. ✗ Different versions - All affected ### Suggested Fix The Next.js frontend should be configured to send API requests to the correct port (3000) or use relative URLs that get properly proxied. ### Config Used ```yaml app: dashboard_url: "http://XXX.XXX.XXX.XXX:8080" log_level: "info" server: external_port: 3000 internal_port: 3001 next_port: 3002 secret: "secret-key-here" domains: example: base_domain: "example.com" cert_resolver: "self-signed" ``` This makes initial setup impossible without modifying the deployment or using workarounds.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#956