owntracks / docker-recorder

Docker image for OwnTracks Recorder
151 stars 68 forks source link

http endpoint dead #50

Closed AeliusSaionji closed 2 years ago

AeliusSaionji commented 2 years ago

The http UI works for a hot second- but there is no data in there. Then, browser is unable to connect. The access log is empty. The log indicates it receives data from devices just fine.

I had the recording running just fine before trying to switch to docker. No idea what's going on here.

ot-recorder[11]: version 0.8.7 starting with STORAGEDIR=/store
ot-recorder[11]: connecting to MQTT on 192.168.1.143:1883 as clientID ot-recorder-d7f6e6647dcd-11 without TLS
ot-recorder[11]: Using access log at /store/httplog/access.log
ot-recorder[11]: HTTP listener started on 127.0.0.1:8083
ot-recorder[11]: Using storage at /store with precision 7
ot-recorder[11]: Subscribing to owntracks/# (qos=2)
* 03:30:48 owntracks/aelius/<redacted>

The owntracks frontend (also in docker) is not getting any data from the recorder image

or-dodson commented 2 years ago

I've been having a very similar problem. My http endpoint is not reachable when I run the image in docker-compose. The port is exposed and bound. When running curl from inside the docker container, the endpoint is available. When running curl on the local machine, it fails with the following message:

curl: (56) Recv failure: Connection reset by peer

This problem, however, does not occur when launching the image from the command line using docker. It is available on the local machine and the internet, and functions perfectly.

I'm running and building these images on an arm64 system.

jpmens commented 2 years ago

That's a bit over my head, unfortunately.... What would be the difference between using plain Docker and -Compose? I was under the impression they'd react similarly so why the difference in availability of the TCP port?

or-dodson commented 2 years ago

I'll post my docker-compose configuration and docker command in case I let slip a difference between those two.

docker-compose:

        owntracks_recorder: 
                build: ./owntracks_recorder/docker-recorder 
                restart: always 
                ports: 
                        - "8083:8083" 
                volumes: 
                        - ./owntracks_recorder/recorder_store:/store 
                        - ./owntracks_recorder/config:/config 
                environment: 
                        - OTR_HOST=mosquitto #hostname of mqtt broker running within docker-compose
                        - OTR_PORT=1883 
                        - OTR_TOPICS='owntracks/iphone/13mini'

docker: docker run -p 8083:8083 -e OTR_HOST=mqtt_website.com evandodson/recorder

or-dodson commented 2 years ago

I figured it out. In the docker-compose, I was using my own recorder.conf which did not set OTR_HTTPHOST which allowed it to go to it's default value of localhost. Setting it to 0.0.0.0 in my recorder.conf fixed the problem.

jpmens commented 2 years ago

Glad you got it working.