jotta / jotta-cli-issues

45 stars 1 forks source link

jotta-cli no socket to connect to after upgrade to v0.14 #183

Closed fenchu closed 2 years ago

fenchu commented 2 years ago

Make sure you are running the latest version of jotta-cli before reporting an issue.

jotta-cli release (jotta-cli version):

jotta-cli version
jotta-cli version 0.14.60923

Error: Could not connect to jottad. Is it running on unix:///run/user/1000/jottad/jottad.socket ?

Description of problem:

jotta-cli not working backup is fine, I got files backup during the night.

I've tried changing everything to the jottad.jottad user as described in the statupscript

cat /etc/systemd/system/jottad.service
[Unit]
Description=Jottacloud cli

[Service]
Type=simple
User=jottad
Group=jottad
EnvironmentFile=-/etc/default/jottad
EnvironmentFile=-/etc/sysconfig/jottad
ExecStart=/usr/bin/jottad 
Restart=always
WorkingDirectory=/

[Install]
WantedBy=multi-user.target
mortenb@mortenb:~$ systemctl status jottad.service
● jottad.service - Jottacloud cli
   Loaded: loaded (/etc/systemd/system/jottad.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2022-08-31 10:57:05 CEST; 6min ago
 Main PID: 4910 (jottad)
    Tasks: 18 (limit: 4915)
   CGroup: /system.slice/jottad.service
           └─4910 /usr/bin/jottad

aug. 31 10:57:05 mortenb systemd[1]: Started Jottacloud cli.
aug. 31 10:57:05 mortenb jottad[4910]: [4910] creating logger @ /var/lib/jottad/jottabackup.log

The files was all roor:root I changed them to jottad:jottad and added both root and mortenb to the group and aølso set the setguid but on the directory and umask to 0002:

mortenb@mortenb:~$ ls -l /var/lib/jottad
totalt 68
-rw-rwS--- 1 jottad jottad 32768 aug.  31 10:57 db
drwxr-sr-x 2 jottad jottad  4096 aug.  31 10:57 downloads
-rw-rwSr-- 1 jottad jottad 14433 aug.  31 10:57 jottabackup.log
-rw-rwS--- 1 jottad jottad 16384 aug.  31 09:59 nstore
-rw-r--r-- 1 jottad jottad   269 aug.  31 10:57 settings.dat
drwxr-sr-x 2 jottad jottad  4096 aug.  31 10:57 uploads
mortenb@mortenb:~$ cat /var/lib/jottad/settings.dat 
{
 "User": {
  "ScanInterval": "1h0m0s",
  "WebhookPostInterval": "6h0m0s",
  "ChecksumRate": 52428800,
  "MaxDownloads": 2,
  "MaxUploads": 2,
  "PhotosMonthAsText": true,
  "BackupScheduleMode": 3,
  "OverrideAutoProxy": true
 },
 "Sync": {},
 "DiagnosticUpload": 1
}

I get it to work for root, but had to create a new webtoken and my config is toast, need to set up backups again. this is a mess, probably just best to uninstall everything and install again.

mortenb@mortenb:~$ jotta-cli login
Error: Could not connect to jottad. Is it running on unix:///run/user/1000/jottad/jottad.socket ?
Usage:
  jotta-cli login [flags]

Flags:
  -h, --help   help for login

Global Flags:
      --host string   the ip address of the host jottad is running on (default "127.0.0.1")
      --port string   the port jottad is listening on (default "14443")

mortenb@mortenb:~$ sudo su -
root@mortenb:~# jotta-cli status
------------------------------------------------------------------------------
 Account   : ##################### on Jottacloud
 Usage     : ####### / ( Unlimited )
 Device    : mortenb
------------------------------------------------------------------------------
 Sync is not enabled 
------------------------------------------------------------------------------
 No folders added to backup yet
------------------------------------------------------------------------------
OK

Expected:

jotta-cli should work for my user.

jotta-cli status (jotta-cli status):

Relevant logs for the issue (~/.jottad/jottabackup.log or /var/lib/jotta/jottabackup.log )

Traceback

Additional info:

fenchu commented 2 years ago

I have tha same issue on antoher machine ubuntu (20:04LTS), backp is fine it is just jotta-cli that do not work:

root@mb:~# systemctl stop jottad.service
root@mb:~# netstat -a | grep 14443
root@mb:~# systemctl start jottad.service
root@mb:~# netstat -a | grep 14443
tcp        0      0 localhost:14443         0.0.0.0:*               LISTEN     
root@mb:~# jotta-cli status
Error: Could not connect to jottad. Is it running on 127.0.0.1:14443 ?

fixed it by running run_jottad as not root user, all seem fine.