Linux terminal showing an error message with the Element application logo on top

Element Desktop Error: Cannot Find Module en-us.json

  • Adam Douglas
  • bug

Over the past several weeks now I’ve been experiencing issues with the Element (Matrix client) desktop application crashing. Searching online appears to show that I’m not the only one with the issue. Looking into the problem myself, I’ve found three problems. One the application is looking for “./i18n/strings/en-us.json” that doesn’t exist. Two, “/usr/lib/element/app.asar/webapp.asar” is not a directory. Three, when the application is able to run, and I close it, I noticed in my journal log of a coredump of Element’s electron process. For those that are not aware Element desktop application is based upon Electron. See below for the console output. What I can confirm is that when the application crashes by starting it, the crash is caused by “/usr/lib/element/app.asar/webapp.asar” not being a directory. When the application is able to run I still receive the error of not finding the locale “en-us.json” without noticeable end user problems.

I realize this needs to be focused on one issue at a time however, this is what I discovered as an end user that lead me to discovering more issues. So I felt it was necessary to break this down. Since I’m not involved in the development of the software these issues maybe related for all I know.

The issues one and three, I’ve been able to find references to the potential bugs I’m experiencing listed below.

As for the second issue, I’ve not yet found anyone talking about it online. I decided to decompress the “app.asar” archive using the below command to see if “webapp.asar” was present. Unfortunately I did not find it. So that was a dead end for me.

$ asar extract /usr/lib/element/app.asar /var/tmp/element/

If anyone can provide information to help or direct me in the right direction, please contact me.

Environment

  • Arch Linux
  • GNU bash v5.1.16
  • Fish v3.3.1
  • GNOME Shell v41.3

Problem

The application crashes when started.

I found out that I can turn on logging in Electron based applications, so I decided to open Element desktop application in the terminal with the “–enable-logging” argument. The following is what is outputted in the terminal when the application is going to crash.

$ element-desktop --enable-logging
/home/adam/.config/Element exists: yes
/home/adam/.config/Riot exists: no
[9571:0213/142115.687747:WARNING:archive.cc(199)] Opening /usr/lib/element/app.asar/webapp.asar: FILE_ERROR_NOT_A_DIRECTORY
No update_base_url is defined: auto update is disabled
Fetching translation json for locale: en_EN
Changing application language to en-us
Fetching translation json for locale: en-us
Could not fetch translation json for locale: 'en-us' Error: Cannot find module './i18n/strings/en-us.json'
Require stack:
- /usr/lib/element/app.asar/lib/language-helper.js
- /usr/lib/element/app.asar/lib/tray.js
- /usr/lib/element/app.asar/lib/electron-main.js
- /usr/lib/electron15/resources/default_app.asar/main.js
-
    at Module._resolveFilename (node:internal/modules/cjs/loader:934:15)
    at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1128)
    at Module._load (node:internal/modules/cjs/loader:779:27)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1006:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at AppLocalization.fetchTranslationJson (/usr/lib/element/app.asar/lib/language-helper.js:76:20)
    at /usr/lib/element/app.asar/lib/language-helper.js:89:39
    at Array.forEach (<anonymous>)
    at AppLocalization.setAppLocale (/usr/lib/element/app.asar/lib/language-helper.js:88:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/lib/element/app.asar/lib/language-helper.js',
    '/usr/lib/element/app.asar/lib/tray.js',
    '/usr/lib/element/app.asar/lib/electron-main.js',
    '/usr/lib/electron15/resources/default_app.asar/main.js',
    undefined
  ]
}
Resetting the UI components after locale change
Resetting the UI components after locale change
[9571:0213/142116.640188:INFO:CONSOLE(2)] "Initialised rageshake.", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142116.640267:INFO:CONSOLE(2)] "To fix line numbers in Chrome: Meatball menu → Settings → Ignore list → Add /rageshake\.js$", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142116.645427:INFO:CONSOLE(2)] "Using Electron platform", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142116.680927:INFO:CONSOLE(2)] "Configuring rageshake persistence...", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
Changing application language to en-us
Fetching translation json for locale: en-us
Could not fetch translation json for locale: 'en-us' Error: Cannot find module './i18n/strings/en-us.json'
Require stack:
- /usr/lib/element/app.asar/lib/language-helper.js
- /usr/lib/element/app.asar/lib/tray.js
- /usr/lib/element/app.asar/lib/electron-main.js
- /usr/lib/electron15/resources/default_app.asar/main.js
-
    at Module._resolveFilename (node:internal/modules/cjs/loader:934:15)
    at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1128)
    at Module._load (node:internal/modules/cjs/loader:779:27)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1006:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at AppLocalization.fetchTranslationJson (/usr/lib/element/app.asar/lib/language-helper.js:76:20)
    at /usr/lib/element/app.asar/lib/language-helper.js:89:39
    at Array.forEach (<anonymous>)
    at AppLocalization.setAppLocale (/usr/lib/element/app.asar/lib/language-helper.js:88:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/lib/element/app.asar/lib/language-helper.js',
    '/usr/lib/element/app.asar/lib/tray.js',
    '/usr/lib/element/app.asar/lib/electron-main.js',
    '/usr/lib/electron15/resources/default_app.asar/main.js',
    undefined
  ]
}
Resetting the UI components after locale change
[9571:0213/142116.722965:INFO:CONSOLE(2)] "Loading skin...", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142116.734691:INFO:CONSOLE(61)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: node:electron/js2c/sandbox_bundle (61)
[9571:0213/142116.737377:INFO:CONSOLE(2)] "Using WebAssembly Olm", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.265848:INFO:CONSOLE(2)] "Skin loaded!", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.284049:INFO:CONSOLE(2)] "set language to en-us", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.308556:INFO:CONSOLE(2)] "Application is running in production mode", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.309131:INFO:CONSOLE(2)] "Vector starting at vector://vector/webapp/", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.309627:INFO:CONSOLE(2)] "Verifying homeserver configuration", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.310299:INFO:CONSOLE(2)] "Config uses a default_server_name - doing .well-known lookup", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142117.310336:INFO:CONSOLE(2)] "DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please use default_server_config instead.", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.220740:INFO:CONSOLE(2)] "Using homeserver config: [object Object]", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.220828:INFO:CONSOLE(2)] "Updating SdkConfig with validated discovery information", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.267369:INFO:CONSOLE(2)] "Got pickle key", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.274663:INFO:CONSOLE(2)] "Restoring session for @thewarden:matrix.org", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.275087:INFO:CONSOLE(2)] "setLoggedIn: mxid: @thewarden:matrix.org deviceId: CMSSTAYJBT guest: false hs: https://matrix-client.matrix.org/ softLogout: false  freshLogin: false", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.279227:INFO:CONSOLE(2)] "StorageManager: Checking storage consistency", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.279353:INFO:CONSOLE(2)] "StorageManager: Local storage supported? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.279424:INFO:CONSOLE(2)] "StorageManager: IndexedDB supported? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.279661:INFO:CONSOLE(2)] "StorageManager: Local storage contains data? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.279736:INFO:CONSOLE(2)] "StorageManager: Crypto initialised? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.282252:INFO:CONSOLE(2)] "StorageManager: Sync store using IndexedDB contains data? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.284518:INFO:CONSOLE(2)] "StorageManager: Crypto store using IndexedDB contains data? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.284594:INFO:CONSOLE(2)] "StorageManager: Storage consistency checks passed", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.301082:INFO:CONSOLE(2)] "Session persisted for @thewarden:matrix.org", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.301280:INFO:CONSOLE(2)] "Lifecycle: Starting MatrixClient", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.316497:INFO:CONSOLE(2)] "StorageManager: Persistent? true", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142118.316822:INFO:CONSOLE(2)] "Switching to room id !PLchWMYJrFZiIbdXGy:matrix.org at event undefined", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142119.206807:INFO:CONSOLE(2)] "EventIndex: Successfully initialized the event index", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142119.209438:INFO:CONSOLE(2)] "EventIndex: Loaded checkpoints ", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142119.210304:INFO:CONSOLE(2)] "IndexedDBStore.startup: connecting to backend", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142119.211252:INFO:CONSOLE(2)] "MatrixClientPeg: waiting for MatrixClient store to initialise", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142119.259344:INFO:CONSOLE(2)] "IndexedDB worker is ready", source: vector://vector/webapp/bundles/1cb4c4953062347d684c/vendors~init.js (2)
[9571:0213/142119.260238:INFO:CONSOLE(1)] "LocalIndexedDBStoreBackend.connect: connecting...", source: vector://vector/webapp/bdc4736dc6bebfc09f05.worker.js (1)
[9571:0213/142119.260778:INFO:CONSOLE(1)] "LocalIndexedDBStoreBackend.connect: awaiting connection...", source: vector://vector/webapp/bdc4736dc6bebfc09f05.worker.js (1)
[9571:0213/142119.261775:INFO:CONSOLE(1)] "LocalIndexedDBStoreBackend.connect: connected", source: vector://vector/webapp/bdc4736dc6bebfc09f05.worker.js (1)
[9571:0213/142119.262167:INFO:CONSOLE(1)] "LocalIndexedDBStoreBackend: loading account data...", source: vector://vector/webapp/bdc4736dc6bebfc09f05.worker.js (1)
[9571:0213/142119.262601:INFO:CONSOLE(1)] "LocalIndexedDBStoreBackend: loading sync data...", source: vector://vector/webapp/bdc4736dc6bebfc09f05.worker.js (1)
[9571:0213/142119.270535:INFO:CONSOLE(1)] "LocalIndexedDBStoreBackend: loaded account data", source: vector://vector/webapp/bdc4736dc6bebfc09f05.worker.js (1)
fish: Job 1, 'element-desktop --enable-logging' terminated by signal SIGTRAP (Trace or breakpoint trap)

Solution

At this time I’ve not been able to find a permanent solution. Best one can do is start Element desktop again or again until it works. Usually it takes two to three tries until the application appears to be working from my testing.

I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting 100DaysToOffload.com.