Compiling Delta Chat for CentOS/RHEL

You are probably in the wrong directory.
what does pwd say?

I am in /deltachat-desktop-git. Again, I am building in a docker container which means that I am root and I unpacked the git archive to the folder just mentioned and ran the command from there as well.

Which directory should I be in?

type ls to see if there is a package.json file in your current directory. if not you probably did something wrong with the zip extraction (you could also use git, otherwise you might need to patch bin/build-shared-version-info.js to work without git). also npm install shouldn’t work when it can’t read what to install from the package.json.

ls shows:

PKGBUILD deltachat-desktop.desktop deltachat-desktop.sh node_modules package-lock.json

I downloaded the git archive with:

git clone https://aur.archlinux.org/deltachat-desktop-git.git

npm install results in:

npm install
npm WARN saveError ENOENT: no such file or directory, open ‘/deltachat-desktop-git/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/deltachat-desktop-git/package.json’
npm WARN deltachat-desktop-git No description
npm WARN deltachat-desktop-git No repository field.
npm WARN deltachat-desktop-git No README data
npm WARN deltachat-desktop-git No license field.

audited 163 packages in 0.629s

6 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

That’s the wrong git archive.
use GitHub - deltachat/deltachat-desktop: Email-based instant messaging for Desktop.

And please at-least read the error messages before asking a question about them :wink:

[Simon] Simon https://support.delta.chat/u/simon
February 21

That’s the wrong git archive.
use GitHub - deltachat/deltachat-desktop: Email-based instant messaging for Desktop. https://github.com/deltachat/deltachat-desktop

And please at-least read the error messages before asking a question about them :wink:


Visit Topic https://support.delta.chat/t/compiling-delta-chat-for-centos-rhel/1496/11 or reply to this email to respond.

To unsubscribe from these emails, click here https://support.delta.chat/email/unsubscribe/a45cf29981ff1549e79c94836efaf17dcc219b86c77059b37a7f095847925ea1.

My fault - of course - and thank you for pointing me in the right direction. After git clone of the above and running:

npm install

in that directory, I see:

npm WARN lifecycle deltachat-desktop@1.15.1~install: cannot run in wd deltachat-desktop@1.15.1 npm run install:submodules (wd=/deltachat-desktop)
npm WARN The package tempy is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

added 1710 packages from 854 contributors and audited 1783 packages in 428.586s

133 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

The above are warnings, not errors. Should I worry about the warnings?

I then ran npm run build and did not see any error messages.

Finally I ran:

npm start

and saw:

deltachat-desktop@1.15.1 start /deltachat-desktop
electron . --debug --log-debug --log-to-console --disable-http-cache --translation-watch

[26133:0221/220210.436288:FATAL:electron_main_delegate.cc(253)] Running as root without --no-sandbox is not supported. See 638180 - chromium - An open-source project to help move the web forward. - Monorail.
/deltachat-desktop/node_modules/electron/dist/electron exited with signal SIGTRAP
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deltachat-desktop@1.15.1 start: electron . --debug --log-debug --log-to-console --disable-http-cache --translation-watch
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deltachat-desktop@1.15.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-02-21T22_02_10_614Z-debug.log

Again, I did this in a docker container and running as root. I will see if I can run as a user but does the above look correct?

yes it looks good, you can ignore the ‘fsevents’ warnings.
Also if you want to run deltachat inside of an docker container you probably need vnc or some other way like x-server forwarding.

reading the message you could also try:

npm run start -- --no-sandbox

Great, thank you. I had tried:

npm start --no-sandbox

earlier which did not work. What you wrote above worked to launch the app and I proceeded to import a backup I had saved from a phone. The account shows up but when I click on account the chats etc do not show up in the app, instead it crashes. The log in /root/.npm/_logs (I run it as root in the docker container) looks like this:

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’,
1 verbose cli ‘/usr/bin/npm’,
1 verbose cli ‘run’,
1 verbose cli ‘start’,
1 verbose cli ‘–’,
1 verbose cli ‘–no-sandbox’ ]
2 info using npm@6.14.11
3 info using node@v10.23.3
4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
5 info lifecycle deltachat-desktop@1.15.1~prestart: deltachat-desktop@1.15.1
6 info lifecycle deltachat-desktop@1.15.1~start: deltachat-desktop@1.15.1
7 verbose lifecycle deltachat-desktop@1.15.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle deltachat-desktop@1.15.1~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/deltachat-desktop/node_modules/.bin:/root/.cargo/bin:/opt/rh/devtoolset-9/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle deltachat-desktop@1.15.1~start: CWD: /deltachat-desktop
10 silly lifecycle deltachat-desktop@1.15.1~start: Args: [ ‘-c’,
10 silly lifecycle ‘electron . --debug --log-debug --log-to-console --disable-http-cache --translation-watch “–no-sandbox”’ ]
11 silly lifecycle deltachat-desktop@1.15.1~start: Returned: code: 1 signal: null
12 info lifecycle deltachat-desktop@1.15.1~start: Failed to exec start script
13 verbose stack Error: deltachat-desktop@1.15.1 start: electron . --debug --log-debug --log-to-console --disable-http-cache --translation-watch "--no-sandbox"
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid deltachat-desktop@1.15.1
15 verbose cwd /deltachat-desktop
16 verbose Linux 3.10.0-1160.2.2.el7.x86_64
17 verbose argv “/usr/bin/node” “/usr/bin/npm” “run” “start” “–” “–no-sandbox”
18 verbose node v10.23.3
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error deltachat-desktop@1.15.1 start: electron . --debug --log-debug --log-to-console --disable-http-cache --translation-watch "--no-sandbox"
22 error Exit status 1
23 error Failed at the deltachat-desktop@1.15.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Can you see what is wrong?

No, you did not include the relevant part of the log.
You can send me the full log should be under ~/.config/DeltaChat/logs.
Make sure to redact/censor sensitive information from it before posting or sending it.
Also running in docker is not an suported use-case so please also try run it outside of docker.

I looked at the log and found two ERROR messages as well as many INFO and DEBUG:

2021-02-22T21:24:35.645Z main/logins ERROR “\n/deltachat-desktop/src/main/logins.ts:77:9,\nfulfilled (/deltachat-desktop/tsc-dist/main/logins.js:24:58)” “Account /root/.config/DeltaChat/accounts/ac0 is inaccessible” “Account is not configured, it is likely an orphaned account (artifact of a failed login in older versions)” {}

2021-02-22T21:24:36.992Z main/logins ERROR “\n/deltachat-desktop/src/main/logins.ts:77:9,\nfulfilled (/deltachat-desktop/tsc-dist/main/logins.js:24:58)” “Account /root/.config/DeltaChat/accounts/ac0 is inaccessible” “Account is not configured, it is likely an orphaned account (artifact of a failed login in older versions)” {}

I do not plan to run it in docker but it was my sandbox for compiling the software with the intent of also testing it. I can move it outside the container, either by compiling it outside or moving stuff from the container. If I go with the latter, which directory trees do I need to move?

  • DeltaChat

  • npm

Anything else?

I suggest I try to get it running outside the container before we do more troubleshooting.

Looks like the import failed somehow.
Also I would package it with electron-builder or do the same stuff on the host machine, I advice against copy pasting files (there is the risk of missing something and you might not have a required dependency installed on the host system).

Follow the packaging steps of the documentation file and use:

electron-builder --config ./electron-builder.json5 --linux --dir

If you can find your target package format for centos in the list on Any Linux Target - electron-builder, use that one instead of --dir:

electron-builder --config ./electron-builder.json5 --linux target_format

I went ahead and compiled it on the desktop since that was the ultimate intention anyway. However, it still crashes, both when trying to import an existing archive and when creating a new account on that e-mail server, ie entering all information anew. This is the end of the output in the terminal window (I can see that it has imported the information but crashes later):

13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/context.rs:146: starting IO
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/scheduler.rs:48: starting inbox loop
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/job.rs:1190: loading job for Imap-thread
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/scheduler.rs:174: starting simple loop for configured_mvbox_folder
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/scheduler.rs:174: starting simple loop for configured_sentbox_folder
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/scheduler.rs:205: starting smtp loop
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/job.rs:1190: loading job for Smtp-thread
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/scheduler.rs:323: scheduler is running
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [i]core/event: DC_EVENT_INFO 0 src/scheduler.rs:228: smtp fake idle - started
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_INFO
13.1s [D]core/event: DC_EVENT_MSGS_CHANGED 11 156
13.1s [D]main/deltachat: sendToRenderer eventType: DC_EVENT_MSGS_CHANGED
13.1s [D]main/deltachat: sendToRenderer eventType: DD_EVENT_CHATLIST_CHANGED
13.1s [D]main/deltachat: sendToRenderer eventType: DD_EVENT_CHAT_MODIFIED
13.2s [D]main/ipc: EVENT_DC_DISPATCH_CB (8) : contacts.getContactIds 0,
/home/hhh/deltachat-desktop/node_modules/electron/dist/electron exited with signal SIGSEGV
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deltachat-desktop@1.15.1 start: electron . --debug --log-debug --log-to-console --disable-http-cache --translation-watch
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deltachat-desktop@1.15.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

I looked in the .config/DeltaChat/logs directory and found no lines labeled ERROR, only DEBUG and INFO.

How can we debug this crash?

I should have added that the last few lines in the .config log are:

2021-02-23T03:01:36.572Z core/event INFO “DC_EVENT_INFO” 0 “src/job.rs:1190: loading job for Smtp-thread”
2021-02-23T03:01:36.572Z main/deltachat DEBUG “sendToRenderer eventType: DC_EVENT_INFO”
2021-02-23T03:01:36.572Z core/event INFO “DC_EVENT_INFO” 0 “src/scheduler.rs:323: scheduler is running”
2021-02-23T03:01:36.573Z main/deltachat DEBUG “sendToRenderer eventType: DC_EVENT_INFO”
2021-02-23T03:01:36.573Z core/event INFO “DC_EVENT_INFO” 0 “src/scheduler.rs:228: smtp fake idle - started”
2021-02-23T03:01:36.573Z main/deltachat DEBUG “sendToRenderer eventType: DC_EVENT_INFO”
2021-02-23T03:01:36.573Z core/event DEBUG “DC_EVENT_MSGS_CHANGED” 11 156
2021-02-23T03:01:36.574Z main/deltachat DEBUG “sendToRenderer eventType: DC_EVENT_MSGS_CHANGED”
2021-02-23T03:01:36.574Z main/deltachat DEBUG “sendToRenderer eventType: DD_EVENT_CHATLIST_CHANGED”
2021-02-23T03:01:36.578Z main/deltachat DEBUG “sendToRenderer eventType: DD_EVENT_CHAT_MODIFIED”
2021-02-23T03:01:36.627Z renderer/ipc DEBUG “sendToBackend: EVENT_DC_DISPATCH_CB 8 contacts.getContactIds 0,”
2021-02-23T03:01:36.628Z main/ipc DEBUG “EVENT_DC_DISPATCH_CB (8) : contacts.getContactIds 0,”

It thus seems that it might crash on contacts.getContactIds??

what’s the deltachat-android version your importing the backup from?

The most recent Android one from the Play Store, ie 1.14.5. But, the app also crashes when I try to create a new account so it is not just when I try to import a backup.

I suggest you do a git checkout to version/tag 1.14.1 and then do the process from the start. 1.15.2-master is still unstable it seems.

OK, just did. Just to note that I previously compiled 1.15.1, not 1.15.2.

Checking out and compiling 1.14.1 results in an error message that libXss is not available which I was able to correct by “yum install libXScrnSaver”, When I then try to launch the application with “npm run start – --no-sandbox” I get a new error message:

Error: Cannot find module ‘./tsc-dist/main’

I have not been able to resolve this issue yet. Might you have a suggestion?

Googling told me that I needed to install

npm install --global typescript

After doing so and going through the build process again the app crashes - both when setting up an account anew or importing an Android backup - with the following last lines in the log file in .config:

2021-02-24T22:29:13.151Z main/deltachat DEBUG “sendToRenderer: DD_EVENT_CHAT_MODIFIED” {“chatId”:11,“chat”:{“id”:11,“name”:“Device messages”,“isProtected”:false,“profileImage”:"/root/.config/DeltaChat/accounts/ac0/db.sqlite-blobs/icon-device.png",“archived”:false,“subtitle”:“Locally generated messages”,“type”:100,“isUnpromoted”:false,“isSelfTalk”:false,“contacts”:[{“address”:“device@localhost”,“color”:"#f23030",“displayName”:“Device messages”,“firstName”:“Device”,“id”:5,“name”:“Device messages”,“profileImage”:"/root/.config/DeltaChat/accounts/ac0/db.sqlite-blobs/icon-device.png",“nameAndAddr”:“Device messages (device@localhost)”,“isBlocked”:false,“isVerified”:false}],“contactIds”:[5],“color”:"#f23030",“freshMessageCounter”:3,“isGroup”:false,“isDeaddrop”:false,“isDeviceChat”:true,“selfInGroup”:false,“muted”:false,“ephemeralTimer”:0}}
2021-02-24T22:29:13.152Z renderer/ipc DEBUG null “backend” “DD_EVENT_CHAT_MODIFIED” {“chat”:{“archived”:false,“color”:"#f23030",“contactIds”:[5],“contacts”:[{“address”:“device@localhost”,“color”:"#f23030",“displayName”:“Device messages”,“firstName”:“Device”,“id”:5,“isBlocked”:false,“isVerified”:false,“name”:“Device messages”,“nameAndAddr”:“Device messages (device@localhost)”,“profileImage”:"/root/.config/DeltaChat/accounts/ac0/db.sqlite-blobs/icon-device.png"}],“ephemeralTimer”:0,“freshMessageCounter”:2,“id”:11,“isDeaddrop”:false,“isDeviceChat”:true,“isGroup”:false,“isProtected”:false,“isSelfTalk”:false,“isUnpromoted”:false,“muted”:false,“name”:“Device messages”,“profileImage”:"/root/.config/DeltaChat/accounts/ac0/db.sqlite-blobs/icon-device.png",“selfInGroup”:false,“subtitle”:“Locally generated messages”,“type”:100},“chatId”:11}
2021-02-24T22:29:13.152Z renderer/ipc DEBUG null “backend” “DC_EVENT_MSGS_CHANGED” [11,12]
2021-02-24T22:29:13.152Z renderer/stores/ChatStore DEBUG null “DC_EVENT_MSGS_CHANGED” 11 12
2021-02-24T22:29:13.152Z renderer/ipc DEBUG null “backend” “DD_EVENT_CHATLIST_CHANGED” {}
2021-02-24T22:29:13.152Z renderer/ipc DEBUG null “backend” “DD_EVENT_CHAT_MODIFIED” {“chat”:{“archived”:false,“color”:"#f23030",“contactIds”:[5],“contacts”:[{“address”:“device@localhost”,“color”:"#f23030",“displayName”:“Device messages”,“firstName”:“Device”,“id”:5,“isBlocked”:false,“isVerified”:false,“name”:“Device messages”,“nameAndAddr”:“Device messages (device@localhost)”,“profileImage”:"/root/.config/DeltaChat/accounts/ac0/db.sqlite-blobs/icon-device.png"}],“ephemeralTimer”:0,“freshMessageCounter”:3,“id”:11,“isDeaddrop”:false,“isDeviceChat”:true,“isGroup”:false,“isProtected”:false,“isSelfTalk”:false,“isUnpromoted”:false,“muted”:false,“name”:“Device messages”,“profileImage”:"/root/.config/DeltaChat/accounts/ac0/db.sqlite-blobs/icon-device.png",“selfInGroup”:false,“subtitle”:“Locally generated messages”,“type”:100},“chatId”:11}
[root@gcc deltachat-desktop]#

Does this tell you what the reason might be?

can you do the testing outside of docker, not as root and without the --no-sandbox?

also when checking out an other version with git you need to start the building process from the beginning:

  1. delete node_modules, html_dist and tsc-dist
  2. npm install
  3. npm run build
  4. npm run start to test
  5. follow the steps to package the app.

I can not see the reason for your crash currently, does it also appear when you use the appimage?
Which email provider do you use?