owntracks / docker-recorder

Docker image for OwnTracks Recorder
151 stars 68 forks source link

Docker-compose website doesn't get populated with data #67

Closed Refferic closed 1 year ago

Refferic commented 1 year ago

Dear sir, madam,

I've got a question, because it doesn't matter what old solution I try to incorporate, the recorder doesn't seem to "fetch" the data from the MQTT and populate the website with the recording points.

I use Traefik2, but primarily in combination with the frontend website. Which, due to the fact that the recorder doesn't receive any data, also doesn't show any information.

Can someone point me in the right direction? The logs (in Portainer) are also empty, so that's something that I also can't utilize at the moment.

The part of my docker-compose.yml file that I use:

  otrecorder:
    container_name: owntracks_recorder
    image: owntracks/recorder
    entrypoint: ot-recorder --http-host 0.0.0.0 owntracks/#
    restart: unless-stopped
    ports:
      - '8083:8083'
    networks:
      - owntracks_internal
    volumes:
      - ./recorderconfig:/config
      - ./recorderstore:/store
    environment:
      - OTR_HTTPHOST=0.0.0.0
      - OTR_HOST=192.168.1.100
      - OTR_POST=1884
      - OTR_USER=xxx
      - OTR_PASS=xxx
      - OTR_STORAGEDIR=/store
    depends_on:
      - mosquitto

  mosquitto:
    container_name: owntracks_mqtt
    image: eclipse-mosquitto
    ports:
      - 1884:1884
      - 8884:8884
    networks:
      - owntracks_internal
    volumes:
      - ./mqttdata:/mosquitto/data
      - ./mqttlogs:/mosquitto/logs
      - ./mqttconfig:/mosquitto/config
    restart: unless-stopped

volumes:
  recorderstore:
  recorderconfig:
  mqttdata:
  mqttlogs:
  mqttconfig:

networks:
  owntracks_internal:
  traefik2_proxy:
    external: true
jpmens commented 1 year ago

Can you please show us the output Recorder should be producing on the console?

Refferic commented 1 year ago

Can you please show us the output Recorder should be producing on the console?

When I'm starting the docker-compose up this is the output in the console.

Creating network "owntracks_owntracks_internal" with the default driver
Creating owntracks_mqtt ... done
Creating owntracks_recorder ... done
Creating owntracks_webserver ... done
Attaching to owntracks_mqtt, owntracks_recorder, owntracks_webserver

Via MQTT Explorer, I can see that the _owntracksmqtt docker container functions and receives the information from my phone app.

And the _owntracksrecorder log in Portainer shows: No log line matching the '' filter, concluding that there is no information getting placed into the log.

jpmens commented 1 year ago

I'm need the output which is produced when the Recorder (ot-recorder) starts up. It ought to begin like this:

ot-recorder[53435] <Debug>: version 0.9.3 starting with STORAGEDIR=
...
Refferic commented 1 year ago

Hmm, I don't seem to be able to add the --debug option to my docker-compose.yml file.

Refferic commented 1 year ago

Bingo! I've used the image: vimagick/ot-recorder to change up the test, since the image: owntrakcs/recorder didn't give me a debug output. However, the vimagick image did give me a debug!

Debug

owntracks_recorder | ot-recorder[1]: gcache_open: mdb_env_open: Permission denied
owntracks_recorder | ot-recorder[1]: Can't initialize gcache in /store/ghash
owntracks_recorder exited with code 1
owntracks_recorder | ot-recorder[1]: version 0.9.0 starting with STORAGEDIR=/store
owntracks_recorder | ot-recorder[1]: gcache_open: mdb_env_open: Permission denied
owntracks_recorder | ot-recorder[1]: Can't initialize gcache in /store/ghash
owntracks_recorder exited with code 1
owntracks_recorder exited with code 1

Fixed by adding :rw to the storages and chmod 777 -R /storage in Ubuntu, so all folders are accessible. After that, I received the next error-message, a typo in the docker-compose.yml

    environment:
      - OTR_HTTPHOST=0.0.0.0
      - OTR_HOST=192.168.1.100
      - OTR_POST=1884

Changed OTR_POST to OTR_PORT and it all worked perfectly!

jpmens commented 1 year ago

Glad to hear you got it going, and thanks for reporting back.

If you can, at some later time, see if you can adjust the directory permissions: 777 invariably gives me ulcers ;) (Honestly, that’s too open.)

Refferic commented 1 year ago

Glad to hear you got it going, and thanks for reporting back.

If you can, at some later time, see if you can adjust the directory permissions: 777 invariably gives me ulcers ;) (Honestly, that’s too open.)

Yeah I know, 755 would be more appropriate, however, that doesn't seem to work. 777 is the only one that seems to work at my end. But I'll try to find a solution for my problem!