Issues With Joplin Server Docker-Compose File | Debian 10

Hello, I am having a hard time trying to get this Joplin server set up. I was following these 2 guilds and both of them result in the same "404 page not found". Not sure what could be the problem and someone can point me in the right direction.

Resources Used:

  • GitHub Joplin Server
  • [Joplin Server on Raspberry]
    (https://discourse.joplinapp.org/t/guide-for-joplin-server-on-raspberry-pi/14702)
    new user so I'm not allowed to put more than 1 link

Docker Compose File:

version: '3'

services:
    db:
        image: postgres:13
        volumes:
            - /home/joplin/data/postgres:/var/lib/postgresql/data
        ports:
            - "5432:5432"
        restart: unless-stopped
        environment:
            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
            - POSTGRES_USER=${POSTGRES_USER}
            - POSTGRES_DB=${POSTGRES_DATABASE}
    app:
        image: etechonomy/joplin-server:latest
        depends_on:
            - db
        ports:
            - "22300:22300"
        restart: unless-stopped
        environment:
            - APP_PORT=${APP_PORT}
            - APP_BASE_URL=${APP_BASE_URL}
            - DB_CLIENT=pg
            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
            - POSTGRES_DATABASE=${POSTGRES_DATABASE}
            - POSTGRES_USER=${POSTGRES_USER}
            - POSTGRES_PORT=${POSTGRES_PORT}
            - POSTGRES_HOST=db

.env File Used:

This is taken from the sample .env file provided by the first resource

APP_BASE_URL=https://notes.example.net/joplin
DB_CLIENT=pg
POSTGRES_PASSWORD=SUPERPASSWORD123
POSTGRES_DATABASE=joplin
POSTGRES_USER=joplin
POSTGRES_PORT=5432
POSTGRES_HOST=localhost
APP_PORT=22300

Log Results:

docker-compose logs -f

app_1  | 2022-09-15 23:51:32: App: Starting services...
app_1  | 2022-09-15 23:51:32: ShareService: Starting maintenance...
app_1  | 2022-09-15 23:51:32: EmailService: Service will be disabled because mailer config is not set or is explicitly disabled
app_1  | 2022-09-15 23:51:32: TaskService: Scheduling #1 (Delete expired tokens): 0 */6 * * *
app_1  | 2022-09-15 23:51:32: TaskService: Scheduling #2 (Update total sizes): 0 * * * *
app_1  | 2022-09-15 23:51:32: TaskService: Scheduling #3 (Process oversized accounts): 30 */2 * * *
app_1  | 2022-09-15 23:51:32: TaskService: Scheduling #7 (Compress old changes): 0 0 */2 * *
app_1  | 2022-09-15 23:51:32: TaskService: Scheduling #8 (Process user deletions): 0 */6 * * *
app_1  | 2022-09-15 23:51:32: App: Call this for testing: `curl https://notes.example.net/joplin/api/ping`
app_1  | 2022-09-15 23:51:32: ShareService: Maintenance completed in 37ms
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /joplin: ::ffff:172.25.5.1: Path not found: joplin
app_1  | 2022-09-15 23:52:38: App: GET /joplin (404) (11ms)
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /joplin/css/bulma.min.css: ::ffff:172.25.5.1: Path not found: joplin/css/bulma.min.css
app_1  | 2022-09-15 23:52:38: App: GET /joplin/css/bulma.min.css (404) (2ms)
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /joplin/js/jquery.min.js: ::ffff:172.25.5.1: Path not found: joplin/js/jquery.min.js
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /joplin/css/fontawesome/css/all.min.css: ::ffff:172.25.5.1: Path not found: joplin/css/fontawesome/css/all.min.css
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /joplin/js/main.js: ::ffff:172.25.5.1: Path not found: joplin/js/main.js
app_1  | 2022-09-15 23:52:38: App: GET /joplin/js/jquery.min.js (404) (2ms)
app_1  | 2022-09-15 23:52:38: App: GET /joplin/css/fontawesome/css/all.min.css (404) (3ms)
app_1  | 2022-09-15 23:52:38: App: GET /joplin/js/main.js (404) (3ms)
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /joplin/css/main.css: ::ffff:172.25.5.1: Path not found: joplin/css/main.css
app_1  | 2022-09-15 23:52:38: App: GET /joplin/css/main.css (404) (1ms)
app_1  | 2022-09-15 23:52:38: [error] App: 404: GET /favicon.ico: ::ffff:172.25.5.1: Path not found: favicon.ico
app_1  | 2022-09-15 23:52:38: App: GET /favicon.ico (404) (1ms)
app_1  | 2022-09-15 23:52:42: [error] App: 404: GET /joplin/login: ::ffff:172.25.5.1: Path not found: joplin/login
app_1  | 2022-09-15 23:52:42: App: GET /joplin/login (404) (1ms)

HTML Output When visiting URL:

Path not found: joplin/login

Go to login page
Joplin Server 2.7.4, copyright © 2021 Laurent Cozic.

Additional Information On Test Machine

I am running this in a debian 10 lxc container within a proxmox server and use HAproxy as my reverse proxy.

How is your reverse proxy configured?

Edit: For visibility purposes, I would advise you to put the env-variables directly in the docker-compose.yml. It makes no difference, but declutters everything a bit.

Edit2: Is the host system arm or amd64?

Thanks for replying, the host system is amd64 and the reverse proxy is set up within pfSense using the HAproxy service. Below is how it is configured

Backend

name forward to address port
joplin adress+port 172.25.5.130 22300

Frontend

Access Control List

Define criteria that will be used with actions defined below to perform them only when certain conditions are met

name expression value
joplin Host starts with: notes.example.net

Actions

Backend to use or perform other actions like calling a lua script, blocking certain requests or others available

action Condition acl names actions
Use Backend joplin backend:Joplin

I have never used ofSense, so I don't know what I'm talking about...my guess would be, that the value of the Access Control List has to be changed to notes.example.net/joplin.

The docker-compose.yml seems correct, so the issue is with the reverse proxy.

Regarding amd64: You can then use the official joplin/server:latest tag, but no must.


Edit: Is this just a typo?

I think it has to be lower case to match the backend config above, doesn't it?

So I changed it to have "/joplin" to the ending of the ACL and now only get 503 error. Checking the logs it seems to be stuck in the maintenace mode. Below is the latest logs using docker-compos logs -f

app_1  | 2022-09-17 00:14:45: App: Auto-migrating database...
app_1  | 2022-09-17 00:14:45: App: Latest migration: { name: '20220201151223_backup_items.js', done: true }
app_1  | 2022-09-17 00:14:45: App: Performing main storage check...
app_1  | 2022-09-17 00:14:45: App: Database storage is special and cannot be checked this way. If the connection to the database was successful then the storage driver should work too.
app_1  | 2022-09-17 00:14:45: App: Starting services...
app_1  | 2022-09-17 00:14:45: ShareService: Starting maintenance...
app_1  | 2022-09-17 00:14:45: EmailService: Service will be disabled because mailer config is not set or is explicitly disabled
app_1  | 2022-09-17 00:14:45: TaskService: Scheduling #1 (Delete expired tokens): 0 */6 * * *
app_1  | 2022-09-17 00:14:45: TaskService: Scheduling #2 (Update total sizes): 0 * * * *
app_1  | 2022-09-17 00:14:45: TaskService: Scheduling #3 (Process oversized accounts): 30 */2 * * *
app_1  | 2022-09-17 00:14:45: TaskService: Scheduling #7 (Compress old changes): 0 0 */2 * *
app_1  | 2022-09-17 00:14:45: TaskService: Scheduling #8 (Process user deletions): 0 */6 * * *
app_1  | 2022-09-17 00:14:45: App: Call this for testing: `curl https://notes.example.net/joplin/api/ping`
app_1  | 2022-09-17 00:14:46: ShareService: Maintenance completed in 397ms
app_1  | 2022-09-17 00:30:00: TaskService: Running #3 (Process oversized accounts) (scheduled)...
app_1  | 2022-09-17 00:30:00: TaskService: Completed #3 (Process oversized accounts) in 351ms

The log is completely fine, this is normal behaviour.

Do you want to reach Joplin at notes.example.com or notes.example.com/joplin? The first one might be easier, then you have to delete the /joplin in the acl again and also set the APP_BASE_URL in the docker-compose.yml file (or .env file) to https://notes.example.com without /joplin.

Someone else had a problem trying to access Joplin server from a sub-directory off the domain rather than using a sub-domain. In that case the reverse proxy was nginx.

What appeared to be happening was that the user wanted to access Joplin from /joplinServer under their domain. The proxy was adding /joplinServer to the base url value which itself already contained /joplinServer, so whilst the actual path wanted was https://domain.com/joplinServer/login the proxy / base url combination interpreted it as https://domain.com/joplinServer/joplinServer/login, hence lots of 404s. The joplinServer could not be removed from the base url as then the base url did not match.

I managed to sort it for nginx by telling nginx to ignore one of the joplinServers using a rewrite. I mention this as it could be that the same is happening with HAProxy so it is something you could investigate.

The easiest solution is to access Joplin Server from the sub-domain https://notes.example.net but I guess there's a reason you do not want to do that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.