Major breaking change in coming Joplin Server 2.0

Thanks, have you tested the server being behind an nginx proxy? What settings work behind nginx?

When I removed the proxy (from both APP_BASE_URL and settingings/Joplin Server URL) it works. Server version 1 worked fine behind Nginx, but seems server version 2 does not (or I am making a mistake).

Thanks again!!

Edit: Figured it out, proxy works again, but APP_BASE_URL cannot be the "real" url, but the after proxy url.

There are a few nginx config above but the important part is to pass the host from the proxy to the server.

CLI v2 has been released now with support for Joplin Server 2.0

1 Like

Sorry if I came off as a little miffed in my comment. I was a little annoyed with the breaking change hitting suddenly, but that's on my for using a beta without pinning to a specific version or watching the forum carefully.

Anyway, thanks for the awesome work you do. I know how thankless open source can be at times. I'm really happy with Joplin - it perfectly fills a gap that I've had in my workflow for years.

1 Like

Does the iOS version (12.0.2) released today support Joplin Server 2.0? I didn't see it in the changelog and just wanted to make sure before switching from webdav to the server.

Thanks!

Yes somehow that's missing from the changelog, but it does support Joplin Server 2.0.

2 Likes

Every time an item is added or deleted the server throws an error:

Thank you!

I upgraded both Joplin Client and Joplin Server, and now I'm seeing the following error out of the client:
image

When I check the server logs (I'm running the server via docker-compose) This is the error I see:

app_1  | 2021-06-17 22:36:08: App: POST /api/sessions (2ms)
app_1  | 2021-06-17 22:36:12: [error] App: TypeError [ERR_INVALID_URL]: Invalid URL:
app_1  |     at onParseError (internal/url.js:258:9)
app_1  |     at new URL (internal/url.js:334:5)
app_1  |     at isValidOrigin (/home/joplin/packages/server/src/utils/routeUtils.ts:158:17)
app_1  |     at Object.<anonymous> (/home/joplin/packages/server/src/utils/routeUtils.ts:189:18)
app_1  |     at Generator.next (<anonymous>)
app_1  |     at /home/joplin/packages/server/dist/utils/routeUtils.js:8:71
app_1  |     at new Promise (<anonymous>)
app_1  |     at __awaiter (/home/joplin/packages/server/dist/utils/routeUtils.js:4:12)
app_1  |     at Object.execRequest (/home/joplin/packages/server/dist/utils/routeUtils.js:169:12)
app_1  |     at /home/joplin/packages/server/src/middleware/routeHandler.ts:10:32 {
app_1  |   input: '',
app_1  |   code: 'ERR_INVALID_URL'
app_1  | }
app_1  | 2021-06-17 22:36:12: App: GET /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application (4ms)
app_1  | 2021-06-17 22:36:22: [error] App: TypeError [ERR_INVALID_URL]: Invalid URL:
app_1  |     at onParseError (internal/url.js:258:9)
app_1  |     at new URL (internal/url.js:334:5)
app_1  |     at isValidOrigin (/home/joplin/packages/server/src/utils/routeUtils.ts:158:17)
app_1  |     at Object.<anonymous> (/home/joplin/packages/server/src/utils/routeUtils.ts:189:18)
app_1  |     at Generator.next (<anonymous>)
app_1  |     at /home/joplin/packages/server/dist/utils/routeUtils.js:8:71
app_1  |     at new Promise (<anonymous>)
app_1  |     at __awaiter (/home/joplin/packages/server/dist/utils/routeUtils.js:4:12)
app_1  |     at Object.execRequest (/home/joplin/packages/server/dist/utils/routeUtils.js:169:12)
app_1  |     at /home/joplin/packages/server/src/middleware/routeHandler.ts:10:32 {
app_1  |   input: '',
app_1  |   code: 'ERR_INVALID_URL'
app_1  | }

Do you pass the host from the proxy to the server?

Yep! Here's my full Nginx vhost config:

server {
    server_name _;

    listen 80       default_server;
	listen [::]:80  default_server;

    return 301 https://$host$request_uri;
}

server {
    server_name _;

	listen 443      ssl  default_server;
	listen [::]:443 ssl  default_server;

    ssl_certificate     /etc/letsencrypt/live/joplin.boxingoctop.us/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/joplin.boxingoctop.us/privkey.pem;

	location / {
	proxy_pass           http://127.0.0.1:22300;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
    }
}

Isn't it related to this line?

app_1 | 2021-06-17 22:36:12: App: GET /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application (4ms)

Sounds like the server is listening to something unrelated?

perhaps, but the INVALID_URL error gets thrown when the app tries to access /api/sessions as well

Did you resolve this? I'm seeing the same error.

Resolved with adding protocol into APP_BASE_URL in server configuration. Like this:

APP_BASE_URL=https://joplin.xyz.com/

Update: I updated to CLI version 2.1.0 and the issue went away. Thanks!

I'm seeing the same issue as some others with the CLI app (v. 2.0.0 prod). I have the Desktop app (v. 2.0.11) and Android app (2.1.3) working perfectly with Joplin Server (v. 2.1.6).

From the CLI app:

╰─❯ joplin sync         
POST api/files/root:/:/children: Not allowed: POST  (400): {"error":"Not allowed: POST "}

And from the logs:

2021-06-28 23:58:45: App: POST /api/sessions (83ms)
2021-06-28 23:58:45: [error] App: 400: POST /api/files/root:/:/children : Not allowed: POST 
2021-06-28 23:58:45: App: POST /api/files/root:/:/children (0ms)

And my CLI app config:

╰─❯ joplin config
dateFormat = DD/MM/YYYY (DD/MM/YYYY: 30/01/2017, DD/MM/YY: 30/01/17, MM/DD/YYYY: 01/30/2017, MM/DD/YY: 01/30/17, YYYY-MM-DD: 2017-01-30, DD.MM.YYYY: 30.01.2017, YYYY.MM.DD: 2017.01.30)
folders.sortOrder.field = title (title: Title, last_note_user_updated_time: Updated date)
layout.folderList.factor = 1
layout.note.factor = 2
layout.noteList.factor = 1
locale = en_GB (ar: Arabic (99%), eu: Basque (31%), bs_BA: Bosnian (Bosna i Hercegovina) (74%), bg_BG: Bulgarian (България) (60%), ca: Catalan (85%), hr_HR: Croatian (Hrvatska) (99%), cs_CZ: Czech (Česká republika) (89%), da_DK: Dansk (Danmark) (96%), de_DE: Deutsch (Deutschland) (98%), et_EE: Eesti Keel (Eesti) (58%), en_GB: English (United Kingdom) (100%), en_US: English (United States of America) (100%), es_ES: Español (España) (97%), eo: Esperanto (34%), fi_FI: Finnish (Suomi) (97%), fr_FR: Français (France) (95%), gl_ES: Galician (España) (39%), id_ID: Indonesian (Indonesia) (96%), it_IT: Italiano (Italia) (97%), hu_HU: Magyar (Magyarország) (91%), nl_BE: Nederlands (België, Belgique, Belgien) (95%), nl_NL: Nederlands (Nederland) (98%), nb_NO: Norwegian (Norge, Noreg) (78%), fa: Persian (74%), pl_PL: Polski (Polska) (97%), pt_BR: Português (Brasil) (97%), pt_PT: Português (Portugal) (97%), ro: Română (68%), sl_SI: Slovenian (Slovenija) (99%), sv: Svenska (63%), th_TH: Thai (ประเทศไทย) (47%), vi: Tiếng Việt (75%), tr_TR: Türkçe (Türkiye) (97%), uk_UA: Ukrainian (Україна) (97%), el_GR: Ελληνικά (Ελλάδα) (85%), ru_RU: Русский (Россия) (97%), sr_RS: српски језик (Србија) (73%), zh_CN: 中文 (简体) (97%), zh_TW: 中文 (繁體) (95%), ja_JP: 日本語 (日本) (98%), ko: 한국어 (97%))
notes.sortOrder.field = user_updated_time (user_updated_time: Updated date, user_created_time: Created date, title: Title, order: Custom order)
notes.sortOrder.reverse = true
revisionService.enabled = true
revisionService.ttlDays = 90
showCompletedTodos = true
sync.5.password = ********
sync.5.path = https://cloud.xxx.xxx/remote.php/webdav/Joplin
sync.5.username = admin@domain.com
sync.8.url = https://s3.amazonaws.com/
sync.9.directory = Apps/Joplin
sync.9.password = ********
sync.9.path = https://joplin.domain.com/
sync.9.username = admin@domain.com
sync.interval = 300 (0: Disabled, 300: 5 minutes, 600: 10 minutes, 1800: 30 minutes, 3600: 1 hour, 43200: 12 hours, 86400: 24 hours)
sync.maxConcurrentConnections = 5
sync.target = 9 (2: File system, 3: OneDrive, 5: Nextcloud, 6: WebDAV, 7: Dropbox, 8: AWS S3 (Beta), 9: Joplin Server)
sync.wipeOutFailSafe = true
timeFormat = HH:mm (HH:mm: 20:30, h:mm A: 8:30 PM)
trackLocation = true
uncompletedTodosOnTop = true