jotta / jotta-cli-issues

45 stars 1 forks source link

Linux: Could not connect to jottad #32

Closed lolicato closed 6 years ago

lolicato commented 6 years ago

Dear Devs,

Probably something went wrong during the updating. I am getting this error:

Could not connect to jottad

The only working things now are the command jotta-cli -help

There is any way to completely remove it and fix it? I try to remove the jotta-cli and reinstall, but nothing changed. I have also tried to remove all the file associated with jotta-cli and jottad but, again, nothing changed.

Do you have any clue I might use for fixing it?

Thanks in advance,

Cheers, Fabio

Kimbsen commented 6 years ago

The 0.4 update did change a few things regarding how jottad is run.

See http://docs.jottacloud.com/jottacloud-command-line-tool/installing-the-command-line-tool/release-notes-for-jottacloud-cli for more information. Specifically the section titled: With the 0.4 release we will introduce some potentially breaking changes to the deb and rpm packages.

sirasjad commented 6 years ago

I have the same issue here. Just installed jotta-cli on Ubuntu 16.04.

sirasjad commented 6 years ago

Apparently I need to type "sudo jottad &" before using jotta-cli, or type "sudo jottad" and keep that terminal window open while using jotta-cli on another terminal window. Where did I go wrong?

existemi commented 6 years ago

@sirajuddin97 indeed the daemon needs to be started prior to using the cli. Init-scripts are installed by default when using deb and rpm packages, which I assume you did running Ubuntu. The daemon is however not started by default when installing. You should be able to start the daemon by running sudo systemctl start jottad.

sirasjad commented 6 years ago

@existemi I did type "sudo systemctl start jottad" right after installing jotta-cli. It prompted me to enter my password, I did and then nothing else happened. Do I need to type "sudo systemctl start jottad" every time I start my computer? Or just once?

existemi commented 6 years ago

That is the correct behavior of systemctl(the password is needed because of sudo). To see that status of the daemon run sudo systemctl status jottad and you should get an output like this:

# sudo systemctl status jottad
● jottad.service - Jottacloud cli
   Loaded: loaded (/etc/systemd/system/jottad.service; enabled)
   Active: active (running) since Tue 2018-02-13 22:21:40 CET; 1 months 12 days ago
 Main PID: 27022 (jottad)
   CGroup: /system.slice/jottad.service
           └─27022 /usr/bin/jottad

The daemon should be started automatically at boot by systemd, so you do not need to start it manually when booting. You are however required to restart the daemon if upgrading by issuing sudo systemctl restart jottad

sirasjad commented 6 years ago

@existemi This is what I get when I type sudo systemctl status jottad:

EDIT: I restarted my laptop and I haven't typed sudo jottad & yet. So now when I type jotta-cli status, it says "Error: Could not connect to jottad". This is what sudo systemctl status jottad shows:

existemi commented 6 years ago

@sirajuddin97 The most likely issue here is that systemdstarts the daemon as the user jottad and permissions to the datadir directory is set to root when you started the daemon manually as root.

To mitigate this do the following (make sure jottadis not running in the background): sudo chown -R jottad.jottad /var/lib/jottad Try to start jottad again after this using sudo systemctl start jotta.

It also seems that the daemon has been disabled for booting at startup because it has failed. (indicated by Loaded: loaded (/etc/systemd/system/jottad.service; disabled; vendor preset: enabled)) If the daemon started correctly but the status still shows disabled as mentioned above, run the following to enable starting at boot: sudo systemctl enable jottad

sirasjad commented 6 years ago

@existemi That worked! Thanks a lot.

eriklysoe commented 6 years ago

@existemi I have the same problem (Could not connect to jotta). Only thing that work is jotta-cli -help

Reinstalled everything, same problem.

Tried you suggestion, did not work sudo chown -R jottad.jottad /var/lib/jottad sudo systemctl start jotta

Ubuntu 18.04.1

systemctl restart jotta Failed to restart jotta.service: Unit jotta.service not found. erik@erik-Precision-WorkStation-T3500:~$ sudo systemctl status jottad ● jottad.service - Jottacloud cli Loaded: loaded (/etc/systemd/system/jottad.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2018-08-31 08:08:35 CEST; 1min 28s ago Process: 8320 ExecStart=/usr/bin/jottad (code=exited, status=1/FAILURE) Main PID: 8320 (code=exited, status=1/FAILURE)

aug. 31 08:08:35 erik-Precision-WorkStation-T3500 systemd[1]: jottad.service: Service hold-off aug. 31 08:08:35 erik-Precision-WorkStation-T3500 systemd[1]: jottad.service: Scheduled restar aug. 31 08:08:35 erik-Precision-WorkStation-T3500 systemd[1]: Stopped Jottacloud cli. aug. 31 08:08:35 erik-Precision-WorkStation-T3500 systemd[1]: jottad.service: Start request re aug. 31 08:08:35 erik-Precision-WorkStation-T3500 systemd[1]: jottad.service: Failed with resu aug. 31 08:08:35 erik-Precision-WorkStation-T3500 systemd[1]: Failed to start Jottacloud cli.

Cheers Erik

henkoegema commented 5 years ago

Any solution to this problem? Last time I got this error, I could only solve it by a new Ubuntu (18.04) installation. A new installation of the jotta service did not solve the problem. All suggestions mentioned in this thread didn't help either.

roflmao commented 5 years ago

Please open a new ticket and provide logs from $ jotta-cli logfile