owntracks / quicksetup

A (mostly) automated installer for OwnTracks Recorder, Frontend with MQTT and Let's Encrypt
https://owntracks.org/booklet/guide/quicksetup/
12 stars 3 forks source link

Trouble installing server #56

Closed erehwon13 closed 3 weeks ago

erehwon13 commented 1 month ago

OwnTracks looks really interesting and I want to dabble with it, though my skills are obviously limited...

This is my first stab at setting up an OwnTracks server. I'm using an Ubuntu 22.04 VM on a locally hosted Proxmox server. It is definitely a dip of the toe in the water for me and I've tried to simplify it as much as possible, but I've still not done very well.

I followed the Quicksetup steps in the OwnTracks Booklet

I got an error about installing ot-recorder but it seems to be installed (using 'which ot-recorder') but the service isn't running. The mosquitto and nginx services are running

TESTING I copied the otrc file and ran it on my Android device but it comes up with a status error of "Connection Refused" I went to http://owntracks.lan and it came up with the "Welcome to nginx!" landing page, with no OwnTracks information. I ran "mosquitto_sub -v -t 'owntracks/#'" but there was no output

SYS.INFO Last bootstrap: 2024-08-04T16:58:46Z Ansible version: 2.17.2 OS distro: Ubuntu / 22 OS distribution: jammy

I'm obviously doing something wrong but I don't know where to start looking. Any pointers you can give we would be greatly appreciated.

jpmens commented 1 month ago

I got an error about installing ot-recorder

Which error? What did it say?

status error of "Connection Refused"

fair enough if the service isn't running

t came up with the "Welcome to nginx

try http://owntracks.lan/owntracks

I'd recommend restarting the procedure and particularly taking note, please, of errors that occur.

jpmens commented 1 month ago

Set dns_domain to owntracks.lan (it can be pinged)

BTW, I assume this is clear to you, but "it can be pinged" is only within your LAN. I would very strongly recommen you select a domain name which belongs to you and which you can access externally. Then configure Let's Encrypt for OwnTracks and your devices will be able to communicate with your server over the Internet, using encrypted communication.

To be clear: your Android device will not find owntracks.lan when you're away from home.

erehwon13 commented 1 month ago

Thanks for your response. Yes, I know the setup is very restricted to my local network, but it suits me to play with it for the time being. Once I get this working, I'll need to set up my environment to be more external. Another learning curve for me!

Here is the error from ot-recorder

fatal: [localhost]: FAILED! => {"cache_update_time": 1723057136, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install 'ot-recorder=0.9.8-0-deb12.6'' failed: E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\not-recorder is already the newest version (0.9.8-0-deb12.6).\n0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.\n1 not fully installed or removed.\nAfter this operation, 0 B of additional disk space will be used.\nSetting up ot-recorder (0.9.8-0-deb12.6) ...\r\ninstall: cannot stat '/usr/share/doc/ot-recorder/ot-recorder.service': No such file or directory\r\ndpkg: error processing package ot-recorder (--configure):\r\n installed ot-recorder package post-installation script subprocess returned error exit status 1\r\nErrors were encountered while processing:\r\n ot-recorder\r\nneedrestart is being skipped since dpkg has failed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "ot-recorder is already the newest version (0.9.8-0-deb12.6).", "0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.", "1 not fully installed or removed.", "After this operation, 0 B of additional disk space will be used.", "Setting up ot-recorder (0.9.8-0-deb12.6) ...", "install: cannot stat '/usr/share/doc/ot-recorder/ot-recorder.service': No such file or directory", "dpkg: error processing package ot-recorder (--configure):", " installed ot-recorder package post-installation script subprocess returned error exit status 1", "Errors were encountered while processing:", " ot-recorder", "needrestart is being skipped since dpkg has failed"]}`

With my limited knowledge, it looks like the script didn't install ot-recorder as it's already up to date, but the service hasn't been configured. (the usr/share/doc/ot-recorder directory is empty, as above)

Going to http://owntracks.lan/owntracks gives a 404 Not Found error.

I've run the bootstrap script a few times and the output is always the same. There aren't any other errors in the output.

Anything else to try?

jpmens commented 1 month ago

(I updated your comment to put console output between two lines of three backticks for clarity)

Could you please do the following:

$ sudo apt remove ot-recorder
$ sudo apt update
$ sudo apt install ot-recorder

and report what you see, please?

erehwon13 commented 3 weeks ago

Sorry for my late reply. I have been away and have only managed to get back onto my sever now.

Good news! That seems to have worked. I re-installed ot-recorder and then re-ran bootstrap.sh. No errors. I then went to the web page and was able to log into the service and instructions were displayed about connecting my phone. I haven't got the the phone app connected yet, but I think that I just need to spend a bit more time ensuring I have the config file imported correctly, I'll look at this properly soon and report back.

Thanks so much for your help with this @jpmens. And also thank you for developing OwnTracks!

jpmens commented 3 weeks ago

Thanks for reporting back, and glad it's working.