Compiling Delta Chat for CentOS/RHEL

I see that Delta Chat is available as Flatpak and AppImage but is it possible to compile it to run natively on CentOS/RHEL 7? If so, I would like to try it.

since when is AppImage not natively? if you can run that you can use GitHub - TheAssassin/AppImageLauncher: Helper application for Linux distributions serving as a kind of "entry point" for running and integrating AppImages to integrate it into your system.

Might be that the “open with URI scheme” is broken in the appimage until 1.15.1, but its not used often anyway.

Having read about problems with AppImages I would rather compile the software myself. I see that you are offering a version for Ubuntu/Debian but I am running another distribution.

How can I compile Delta Chat for RHEL/CentOS 7?

deltachat-desktop/README.md at master · deltachat/deltachat-desktop · GitHub

But I would git checkout <tag> to the tag of the version you want, the master branch tends to be more unstable than tagged versions.

For packaging:

Thank you, just began trying to build in a CentOS 7 docker container. After downloading various dependencies I got stuck after
NODE_ENV=production npm run build
and then
Generate the electron-builder.json5 file with npm run pack:generate_config
results in:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /deltachat-desktop-git/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open ‘/deltachat-desktop-git/package.json’
npm ERR! enoent This is related to npm not being able to find a file.

Have I missed to install something?

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 https://crbug.com/638180.
/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?