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

[Bug]: [macos-notification-state] failed to load 'notificationstate' #3211

Open
6 tasks done
naveenyagati opened this issue Nov 19, 2024 · 8 comments
Open
6 tasks done

Comments

@naveenyagati
Copy link

naveenyagati commented Nov 19, 2024

Checks before filing an issue

Mattermost Desktop Version

5.10.0

Operating System

Kali GNU/Linux Rolling

Mattermost Server Version

9.6.1

Steps to reproduce

mattermost desktop app does not open anymore, I tried running mattermost-desktop on cmd and got the following error.

13:21:54.778 › Logger Log level set to: info [macos-notification-state] failed to load 'notificationstate' addon Error: Module did not self-register: '/opt/Mattermost/resources/app.asar.unpacked/node_modules/macos-notification-state/build/Release/notificationstate.node'. at process.func [as dlopen] (node:electron/js2c/node_init:2:2559) at Module._extensions..node (node:internal/modules/cjs/loader:1602:18) at Object.func [as .node] (node:electron/js2c/node_init:2:2786) at Module.load (node:internal/modules/cjs/loader:1295:32) at Module._load (node:internal/modules/cjs/loader:1111:12) at c._load (node:electron/js2c/node_init:2:16955) at Module.require (node:internal/modules/cjs/loader:1318:19) at require (node:internal/modules/helpers:179:18) at bindings (/opt/Mattermost/resources/app.asar/node_modules/bindings/bindings.js:112:48) at safeLoad (/opt/Mattermost/resources/app.asar/node_modules/macos-notification-state/lib/index.js:3:31) { code: 'ERR_DLOPEN_FAILED' } Checking for beta autoupdate feature for deb/rpm distributions Found package-type: deb

Expected behavior

Observed behavior

App wont open

Log Output

13:21:54.778 › Logger Log level set to: info
[macos-notification-state] failed to load 'notificationstate' addon Error: Module did not self-register: '/opt/Mattermost/resources/app.asar.unpacked/node_modules/macos-notification-state/build/Release/notificationstate.node'.
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)
    at Module._extensions..node (node:internal/modules/cjs/loader:1602:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2786)
    at Module.load (node:internal/modules/cjs/loader:1295:32)
    at Module._load (node:internal/modules/cjs/loader:1111:12)
    at c._load (node:electron/js2c/node_init:2:16955)
    at Module.require (node:internal/modules/cjs/loader:1318:19)
    at require (node:internal/modules/helpers:179:18)
    at bindings (/opt/Mattermost/resources/app.asar/node_modules/bindings/bindings.js:112:48)
    at safeLoad (/opt/Mattermost/resources/app.asar/node_modules/macos-notification-state/lib/index.js:3:31) {
  code: 'ERR_DLOPEN_FAILED'
}
Checking for beta autoupdate feature for deb/rpm distributions
Found package-type: deb

Additional Information

No response

@felixhekhorn
Copy link

I can confirm this.

$ mattermost-desktop --version
12:50:43.896 › Logger Log level set to: info
[macos-notification-state] failed to load 'notificationstate' addon Error: Module did not self-register: '/opt/Mattermost/resources/app.asar.unpacked/node_modules/macos-notification-state/build/Release/notificationstate.node'.
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)
    at Module._extensions..node (node:internal/modules/cjs/loader:1602:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2786)
    at Module.load (node:internal/modules/cjs/loader:1295:32)
    at Module._load (node:internal/modules/cjs/loader:1111:12)
    at c._load (node:electron/js2c/node_init:2:16955)
    at Module.require (node:internal/modules/cjs/loader:1318:19)
    at require (node:internal/modules/helpers:179:18)
    at bindings (/opt/Mattermost/resources/app.asar/node_modules/bindings/bindings.js:112:48)
    at safeLoad (/opt/Mattermost/resources/app.asar/node_modules/macos-notification-state/lib/index.js:3:31) {
  code: 'ERR_DLOPEN_FAILED'
}
Checking for beta autoupdate feature for deb/rpm distributions
Found package-type: deb
5.10.0

and also window would not open.

I have also a possibly related uncaught exception:

Application: Mattermost 5.10.0 [commit: 869aead
]
Platform: Linux 6.11.8-1-siduction-amd64 x64
Error: write EIO
    at afterWriteDispatched (node:internal/stream_base_commons:161:15)
    at writeGeneric (node:internal/stream_base_commons:152:3)
    at Socket._writeGeneric (node:net:954:11)
    at Socket._write (node:net:966:8)
    at writeOrBuffer (node:internal/streams/writable:570:12)
    at _write (node:internal/streams/writable:499:10)
    at Writable.write (node:internal/streams/writable:508:10)
    at console.value (node:internal/console/constructor:310:16)
    at console.error (node:internal/console/constructor:394:26)
    at Function.writeFn (/opt/Mattermost/resources/app.asar/index.js:2:932907)

Let me also point out the "macos-notification-state" on a Linux system

@devinbinnie
Copy link
Member

That macos-notification-state log entry is a red herring, and has been there since we started using the module (it doesn't load on Linux because it's not needed. I can load v5.10 on Ubuntu, with that message popping up in my log and the app loads and works correctly.

Is there any other information in the logs? Do you have AppArmor running? Are you trying to run as root?

@felixhekhorn
Copy link

Is there any other information in the logs?

in .config/Mattermost/logs/main.log I have with yesterdays timestamp

[2024-11-19 12:22:25.608] [error] [WebContentsEventM...] [renderer] TypeError: Failed to fetch
[2024-11-19 12:22:25.639] [error] [WebContentsEventM...] [renderer] com.mattermost.calls: TypeError: Failed to fetch
[2024-11-19 12:35:40.641] [error] Logger Log level set to: info
[2024-11-19 12:35:40.761] [warn]  [App.Initialize] Current working directory is /home/felix, changing into /opt/Mattermost
[2024-11-19 12:35:40.856] [info]  [App.Config] config.autostart has been configured: true
[2024-11-19 12:35:40.925] [info]  [App.Initialize] Autoupgrade disabled: false
[2024-11-19 12:35:40.980] [info]  [ServerDropdownView] init
[2024-11-19 12:35:41.019] [info]  [i18nManager] Set new language de
[2024-11-19 12:35:41.209] [info]  [App.Config] config.autostart has been configured: true
[2024-11-19 12:35:43.024] [info]  [App.Config] config.autostart has been configured: true
[2024-11-19 15:49:35.864] [error] [WebContentsEventM...] [renderer] TypeError: Failed to fetch
[2024-11-19 15:49:35.908] [error] [WebContentsEventM...] [renderer] Uncaught (in promise) Error: Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.

is this what you are asking for?

However, the problem is already around for a couple of days for me and I don't remember since when exactly ... I was suspecting it was related to an update of my system packages.

Do you have AppArmor running?

I'm using Debian unstable - so I think it is built into the kernel, no? (if I understood correctly - not sure)

Are you trying to run as root?

no

and the app loads and works correctly.

just to clarify: the app seems to run, i.e. htop shows it (and I can terminate it from there and launch it again and it appears back in the list), but the window does not pop-up

@devinbinnie
Copy link
Member

I'm using Debian unstable

This might be part of the problem, not sure what might have changed in their repo. I would recommended switching back to stable if you can and see if it's reproducible from there. FWIW technically we only support Ubuntu officially, so an unstable Debian build doesn't actually fall under our support umbrella.

so I think it is built into the kernel, no?

I'm not entirely sure either, but if it is you may want to look at this ticket: mattermost/mattermost#28444

@naveenyagati
Copy link
Author

I noticed something weird, on open mattermost://community.mattermost.com/core/channels/desktop-app the app opens, but does not respond when trying to open it using the icon.

@felixhekhorn
Copy link

I noticed something weird, on open mattermost://community.mattermost.com/core/channels/desktop-app the app opens, but does not respond when trying to open it using the icon.

again I can confirm that - but there are even more strange things happening ... I don't have the time at the moment to play around unfortunately, but maybe you can already guess something ... here is what happened in the last 10 min:

  1. I copied the command into a terminal; the window opened; an additional pop-up opened; I was so happy that it was back working I just clicked the pop-up away; I started to write this post and thought the pop-up might be relevant after all; I closed the window again
  2. I copied the command again into the terminal; the window opened; the pop-up says that the server can not be found (which is just fine, we are using a different one); I continued to write this post; I wanted to double check the pop-up, but the window has crashed in the meantime; on the console the following output has appeared
15:31:46.044 › [App.Config] config.autostart has been configured: true
15:31:46.130 › [App.Initialize] Autoupgrade disabled: false
15:31:46.198 › [ServerDropdownView] init
15:31:46.251 › [i18nManager] Set new language de
15:31:46.480 › [App.Config] config.autostart has been configured: true
[2370436:1125/153147.539153:ERROR:nss_util.cc(345)] After loading Root Certs, loaded==false: NSS error code: -8018
15:31:48.475 › [App.Config] config.autostart has been configured: true
  1. I killed the process; copied the command to the terminal; clicked the pop-up away; and since then the window remained (now 8min back)

@felixhekhorn
Copy link

So the window is still there, but it seems there is a memory leak around:

(node:2370436) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 closed listeners added to [BrowserWindow]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use `mattermost-desktop --trace-warnings ...` to show where the warning was created)

@devinbinnie
Copy link
Member

So the window is still there, but it seems there is a memory leak around:

(node:2370436) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 closed listeners added to [BrowserWindow]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use `mattermost-desktop --trace-warnings ...` to show where the warning was created)

This is also a red herring, this is a message from Node, we just add a lot of listeners to our Main Window object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants