arpanghosh8453 / public-fitbit-projects

A script to fetch data from Fitbit servers using their API and store the data in a local influxdb database.
BSD 4-Clause "Original" or "Old" License
323 stars 29 forks source link

File permission issue when running "docker-compose run publicfitbitprojects" #3

Closed badi95 closed 1 year ago

badi95 commented 1 year ago

When trying to get the system setup and I run docker-compose run publicfitbitprojects I keep getting the following error:

Successfully tagged publicfitbitprojects:latest
WARNING: Image for service publicfitbitprojects was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating fitbit-data_publicfitbitprojects_run ... done
Traceback (most recent call last):
  File "/app/Fitbit_Fetch.py", line 39, in <module>
    with open(FITBIT_LOG_FILE_PATH, "w"): pass
PermissionError: [Errno 13] Permission denied: '/app/logs/fitbit.log'
arpanghosh8453 commented 1 year ago

Could you let me know if you updated the FITBIT_LOG_FILE_PATH variable with a valid path? It seems the issue is the internal /app/logs/fitbit.log path is not accessible, so I am wondering if it was mapped to a path on your disk correctly.

badi95 commented 1 year ago

I didn't change anything i the docker compose file except for CLIENT_ID and CLIENT_SECRET. I can try changing it to a path on my host system and see if that makes a difference.

badi95 commented 1 year ago

This time I got this error FileNotFoundError: [Errno 2] No such file or directory:

arpanghosh8453 commented 1 year ago

Do you already have the grafana influxdb setup? Try running the py file only without using docker. You NEED to update the variables with placeholders.

badi95 commented 1 year ago

Ok I ended up being able to get to the token request by changing making a fibit-logs diretory in top level directory and FITBIT_LOG_FILE_PATH to fitbit-logs. The issue seems to be from the appuser trying to access the logs volume.

arpanghosh8453 commented 1 year ago

Thank you for the information. I hope you enjoy the dashboard :)