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

Attempting to share notebook with self hosted joplin server, cannot read properties of null #5990

Closed
draggor opened this issue Jan 10, 2022 · 8 comments
Labels
bug It's a bug

Comments

@draggor
Copy link

draggor commented Jan 10, 2022

I am trying to share a notebook with another user on my self hosted joplin server install, however I get a null exception and don't know why.

Environment

Server:
Joplin version: server-v2.6.14
Platform: linux x64
OS specifics: Ubuntu 20.04.3, 5.4.0-72-generic

Client:
Joplin 2.6.10 (prod, win32)

Client ID: 54c702d6b88f4b5ab1d68303a1e0dcd8
Sync Version: 3
Profile Version: 41
Keychain Supported: Yes

Revision: 98fba37

Steps to reproduce

  1. Right click top level note, select share
  2. put in another user's email address that's verified and working on the server, press share
  3. Error as per below:

image

Describe what you expected to happen

I expect no errors, I expect sharing to work, and to list the recipient.

Logfile

2022-01-10 00:37:31: [error] App: TypeError: Cannot read properties of null (reading 'id')
    at /home/joplin/packages/server/src/routes/api/users.ts:39:11
    at Generator.next (<anonymous>)
    at fulfilled (/home/joplin/packages/server/dist/routes/api/users.js:5:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
@draggor draggor added the bug It's a bug label Jan 10, 2022
@laurent22
Copy link
Owner

It's already been fixed and will be in the next release.

@draggor
Copy link
Author

draggor commented Jan 11, 2022

Does that mean this is a client side bug and not the server? I'm currently at HEAD detached at server-v2.6.14 for the server.

@mariovor
Copy link

I see the same error

2022-01-30 14:28:05: [error] App: 77.180.xxx.xxx TypeError: Cannot read properties of null (reading 'id')
    at /home/joplin/packages/server/src/routes/api/users.ts:39:11
    at Generator.next (<anonymous>)
    at fulfilled (/home/joplin/packages/server/dist/routes/api/users.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

while trying to share with these versions

Server: v2.7.3 (prod) (via Docker).

Joplin 2.6.10 (prod, linux)

Client-ID: 4a3946b5709444999284e96a1cd393fb
Sync-Version: 3
Profil-Version: 41
Unterstützter Schlüsselbund: Nein

Revision: 98fba37

@laurent22
Copy link
Owner

I'm pretty sure you're not on server 2.7.3 because that line is not there anymore.

@mariovor
Copy link

mariovor commented Jan 30, 2022

> @joplin/server@2.7.3 start
> node dist/app.js

2022-01-30 16:09:24: App: Starting server v2.7.3 (prod) on port 22300 and PID 19...
2022-01-30 16:09:24: App: NTP time offset: -4ms
2022-01-30 16:09:24: App: Running in Docker: true
2022-01-30 16:09:24: App: Public base URL: https://joplin.xxx.dev
2022-01-30 16:09:24: App: API base URL: https://joplin.xxx.dev
2022-01-30 16:09:24: App: User content base URL: https://joplin.xxx.dev
2022-01-30 16:09:24: App: Log dir: /home/joplin/packages/server/logs
2022-01-30 16:09:24: App: DB Config: {
  client: 'pg',
  name: 'postgres',
  slowQueryLogEnabled: false,
  slowQueryLogMinDuration: 1000,
  autoMigration: true,
  user: 'postgres',
  password: '********',
  port: 5432,
  host: 'db'
}
2022-01-30 16:09:24: App: Mailer Config: {
  enabled: false,
  host: '',
  port: 587,
  secure: true,
  authUser: '',
  authPassword: '********',
  noReplyName: '',
  noReplyEmail: ''
}
2022-01-30 16:09:24: App: Content driver: { type: 1 }
2022-01-30 16:09:24: App: Content driver (fallback): null
2022-01-30 16:09:24: App: Trying to connect to database...
2022-01-30 16:09:25: App: Connection check: {
  latestMigration: { name: '20211204191051_user_deletion.js', done: true },
  isCreated: true,
  error: null
}
2022-01-30 16:09:25: App: Auto-migrating database...
2022-01-30 16:09:25: App: Latest migration: { name: '20211204191051_user_deletion.js', done: true }
2022-01-30 16:09:25: App: Performing main storage check...
2022-01-30 16:09:25: 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.
2022-01-30 16:09:25: App: Starting services...
2022-01-30 16:09:25: ShareService: Starting maintenance...
2022-01-30 16:09:25: EmailService: Service will be disabled because mailer config is not set or is explicitly disabled
2022-01-30 16:09:25: TaskService: Scheduling #1 (Delete expired tokens): 0 */6 * * *
2022-01-30 16:09:25: TaskService: Scheduling #2 (Update total sizes): 0 * * * *
2022-01-30 16:09:25: TaskService: Scheduling #3 (Process oversized accounts): 30 */2 * * *
2022-01-30 16:09:25: TaskService: Scheduling #7 (Compress old changes): 0 0 */2 * *
2022-01-30 16:09:25: TaskService: Scheduling #8 (Process user deletions): 0 */6 * * *
2022-01-30 16:09:25: App: Call this for testing: `curl https://joplin.xxx.dev/api/ping`
2022-01-30 16:09:25: ShareService: Maintenance completed in 72ms
2022-01-30 16:09:49: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (10ms)
2022-01-30 16:09:49: App: GET /api/shares (200) (21ms)
2022-01-30 16:09:49: App: GET /api/shares (200) (27ms)
2022-01-30 16:09:49: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (4ms)
2022-01-30 16:09:49: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (8ms)
2022-01-30 16:09:49: App: GET /api/items/root:/info.json:/content (200) (105ms)
2022-01-30 16:09:49: App: POST /api/locks (200) (10ms)
2022-01-30 16:09:49: App: GET /api/items/root:/:/delta (200) (8ms)
2022-01-30 16:09:49: App: DELETE /api/locks/1_1_4a3946b5709444999284e96a1cd393fb (200) (6ms)
2022-01-30 16:09:49: App: GET /api/share_users (200) (3ms)
2022-01-30 16:09:49: App: GET /api/shares (200) (7ms)
2022-01-30 16:09:49: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (13ms)
2022-01-30 16:10:01: App: POST /api/shares (200) (11ms)
2022-01-30 16:10:01: [error] App: 77.180.xxx.xxx TypeError: Cannot read properties of null (reading 'id')
    at /home/joplin/packages/server/src/routes/api/users.ts:39:11
    at Generator.next (<anonymous>)
    at fulfilled (/home/joplin/packages/server/dist/routes/api/users.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-01-30 16:10:02: App: GET /api/users/heike%xxxx.de/public_key (500) (86ms)
2022-01-30 16:10:02: App: GET /api/shares (200) (8ms)
2022-01-30 16:10:02: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (4ms)
2022-01-30 16:10:02: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (3ms)
2022-01-30 16:10:02: App: GET /api/items/root:/info.json:/content (200) (12ms)
2022-01-30 16:10:02: App: POST /api/locks (200) (36ms)
2022-01-30 16:10:02: App: PUT /api/items/root:/info.json:/content (200) (27ms)
2022-01-30 16:10:02: App: DELETE /api/locks/2_1_4a3946b5709444999284e96a1cd393fb (200) (5ms)
2022-01-30 16:10:02: App: POST /api/locks (200) (6ms)
2022-01-30 16:10:02: App: GET /api/items/root:/a85bec9774fd4a1baec8469a85e1bc13.md: (200) (4ms)
2022-01-30 16:10:02: App: GET /api/items/root:/a85bec9774fd4a1baec8469a85e1bc13.md:/content (200) (9ms)
2022-01-30 16:10:02: App: PUT /api/items/root:/a85bec9774fd4a1baec8469a85e1bc13.md:/content (200) (30ms)
2022-01-30 16:10:02: App: GET /api/items/root:/:/delta (200) (10ms)
2022-01-30 16:10:03: App: DELETE /api/locks/1_1_4a3946b5709444999284e96a1cd393fb (200) (6ms)
2022-01-30 16:10:03: App: GET /api/share_users (200) (2ms)
2022-01-30 16:10:03: App: GET /api/shares (200) (2ms)
2022-01-30 16:10:03: App: GET /api/shares/Bee3SKsk2D8v38dfUsjP8d/users (200) (3ms)
2022-01-30 16:10:12: ShareService: Starting maintenance...
2022-01-30 16:10:12: ShareService: Maintenance completed in 63ms

That's what I have....

@laurent22
Copy link
Owner

Ok that's because:

It's already been fixed and will be in the next release.

@mariovor
Copy link

Argh, I did not check the date of the 2.7.3 release. Sorry!

@marcolaux
Copy link

marcolaux commented Feb 5, 2022

I still get this message with 2.7.8.
@mariovor Could you give me a hint how you solved it?

Edit: I upgraded my server from 2.7.3 to 2.7.4 (latest docker image to this date) and now it works. all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests

4 participants