ente-io / ente

Fully open source, End to End Encrypted alternative to Google Photos and Apple Photos
https://ente.io
GNU Affero General Public License v3.0
16.14k stars 833 forks source link

When trying to run ente cli from a server it fails on dbus-launch #1328

Open I-Would-Like-To-Report-A-Bug-Please opened 7 months ago

I-Would-Like-To-Report-A-Bug-Please commented 7 months ago

Description

Tried to run ente cli on my docker server however I can't due to missing dbus-launch.

root@docker:~/docker/ente# ./ente
2024/04/05 10:52:54 error getting password from keyring: exec: "dbus-launch": executable file not found in $PATH

Version

cli-v0.1.13

What product are you using?

No response

What platform are you using?

Server

AlexandarY commented 7 months ago

Issue appears to be coming from the use of https://github.com/zalando/go-keyring . This module requires the secret service dbus interface. To get it to work on my end (in a Debian Bookworm container), I had to do the following:

  1. Install these packages - apt install gnome-keyring libsecret dbus-x11
  2. Create the default collection. Setting this up without an X11 Server is a bit tricky, but the steps described here do work:
eval "$(dbus-launch --sh-syntax)"

mkdir -p ~/.cache
mkdir -p ~/.local/share/keyrings # where the automatic keyring is created

# 1. Create the keyring manually with a dummy password in stdin
eval "$(printf '\n' | gnome-keyring-daemon --unlock)"

# 2. Start the daemon, using the password to unlock the just-created keyring:
eval "$(printf '\n' | /usr/bin/gnome-keyring-daemon --start)"

Also if you are trying to use the CLI to create an account, make sure that the yaml config file has the hardcoded-ott.emails value set for the user you are trying to use, otherwise you won't be able to use the CLI or even log in.

I-Would-Like-To-Report-A-Bug-Please commented 7 months ago

Thanks for the tip, definitely can do it but amount of other X dependencies that I guess many people would like to avoid on the typical headless servers is quite a big list(at least ubuntu server 22):

The following additional packages will be installed:
  adwaita-icon-theme at-spi2-core dconf-gsettings-backend dconf-service fontconfig fontconfig-config fonts-dejavu-core
  gcr gnome-keyring-pkcs11 gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3
  libcairo-gobject2 libcairo2 libcolord2 libcups2 libdatrie1 libdconf1 libdeflate0 libepoxy0 libfontconfig1 libgck-1-0
  libgcr-base-3-1 libgcr-ui-3-1 libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgraphite2-3
  libgtk-3-0 libgtk-3-bin libgtk-3-common libharfbuzz0b libjbig0 libjpeg-turbo8 libjpeg8 liblcms2-2
  libpam-gnome-keyring libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 librsvg2-2 librsvg2-common
  libsecret-common libthai-data libthai0 libtiff5 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp7
  libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon0
  libxrandr2 libxrender1 libxtst6 p11-kit p11-kit-modules pinentry-gnome3 session-migration ubuntu-mono x11-common

I guess it it is and might be hard to change but definitely it's not ideal :/

I'll give it a look bit later though.

diva-in-STEM commented 1 month ago

Hi there, I'm trying to get this working but I'm running into this error: error getting password from keyring: failed to unlock correct collection '/org/freedesktop/secrets/aliases/default' I'm trying to run it on a raspberry pi 5 using the 64 bit raspbian lite OS (I'm trying to run the arm64 version BTW)

raphaelm commented 1 month ago

Installing these packages is not an option on all systems, e.g. I try to download photos to my Synology NAS. Any other workarounds?

diva-in-STEM commented 1 month ago

Hi, sorry, I have fixed it! Turns out I had the IP address wrong for the s3 buckets and running the CLI on my windows machine worked wonderfully!

raphaelm commented 1 month ago

I was referring to the original issue here that dbus-launch is required which is not present on my Synology NAS. Interestingly, the Docker version works – why? Either dbus is required or it isn't?