Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open "(...)transmission-telegram.log: no such file or directory" #35

Open
nlhomme opened this issue Jan 8, 2021 · 8 comments
Open

open "(...)transmission-telegram.log: no such file or directory" #35

nlhomme opened this issue Jan 8, 2021 · 8 comments

Comments

@nlhomme
Copy link

nlhomme commented Jan 8, 2021

Hi there!

I can't set any log file when I try to run the container.
It's says that my log files cannot be found:

root@proliant:[~]|20:18:48|# docker rm transmission-telegram && /usr/bin/docker run --name transmission-telegram kevinhalpin/transmission-telegram -token=<toker> -master=nicolaslhomme -url=http://172.29.137.184:9091/transmission/rpc --logfile=/mnt/datastore/Telechargements/transmission-home/transmission-telegram.log 
transmission-telegram
2021/01/08 19:19:10 open /mnt/datastore/Telechargements/transmission-home/transmission-telegram.log: no such file or directory

I can't understand since the file is readable from everybody:

root@proliant:[~]|20:19:10|# ll /mnt/datastore/Telechargements/transmission-home/transmission-telegram.log
-rw-r--r-- 1 root nicolas 0 Jan  7 22:52 /mnt/datastore/Telechargements/transmission-home/transmission-telegram.log

I've got the same issue when I try to set the tranmission logfile:

root@proliant:[~]|20:19:26|# docker rm transmission-telegram && /usr/bin/docker run --name transmission-telegram kevinhalpin/transmission-telegram -token=<token> -master=nicolaslhomme -url=http://172.29.137.184:9091/transmission/rpc  -transmission-logfile=/mnt/datastore/Telechargements/transmission-home/transmission.log
transmission-telegram
2021/01/08 19:24:20 [INFO] Token=<token>
		Masters=[nicolaslhomme]
		URL=http://172.29.137.184:9091/transmission/rpc
		USER=
		PASS=
2021/01/08 19:24:20 [ERROR] tailing transmission log: open /mnt/datastore/Telechargements/transmission-home/transmission.log: no such file or directory
2021/01/08 19:24:20 [INFO] Authorized: nlh_c3po_bot

root@proliant:[~]|20:25:06|# ll /mnt/datastore/Telechargements/transmission-home/transmission.log
-rw-r--r-- 1 root nicolas 19097833 Jan  8 20:23 /mnt/datastore/Telechargements/transmission-home/transmission.log

What am I missing? Can you help me?

@nlhomme
Copy link
Author

nlhomme commented Jan 8, 2021

Of course, the token has been obfuscated to submit this issue

@pyed pyed assigned pyed and unassigned pyed Jan 9, 2021
@pyed
Copy link
Owner

pyed commented Jan 9, 2021

it's probably an issue with your permissions, maybe @aleksanderson or @kevinhalpin can help with that.

@kevinhalpin
Copy link
Contributor

Yeah I’m guessing permissions too. Users and Groups inside the container are not mapped to to the same user/groups within the container. Could you run a ls -lAh on those files and the dir directly above the inside and outside of the container.

@nlhomme
Copy link
Author

nlhomme commented Jan 10, 2021

Hi,

Here is the "ls -lAh" from outside the container:

root@proliant:[~]|20:46:33|# ls -lAh /mnt/datastore/Telechargements/transmission-home/*.log
-rw-r--r-- 1 root nicolas 19M Jan 10 20:46 /mnt/datastore/Telechargements/transmission-home/transmission.log
-rw-r--r-- 1 root nicolas   0 Jan  7 22:52 /mnt/datastore/Telechargements/transmission-home/transmission-telegram.log

root@proliant:[~]|20:46:53|# ls -lAh /mnt/datastore/Telechargements/
total 28K
(...)
drwxr-sr-x 5 root    nicolas 4.0K Jan 10 20:41 transmission-home
(...)

Those commands from inside the container will not work since the path is not mounted on the container.
This is probably what I am missing.

When I read the README of the repo you can mount your file system like this when you're using docker compose:

(...)
    volumes:
      - ${CONFIG}/transmission:/config
      - ${DATA}/transmission/downloads:/downloads
(...)

But as you see on my first message I use the standalone way, but neither the README or the wiki tells how to mount the file system. How can I proceed?

Regards

@kevinhalpin
Copy link
Contributor

if you desire the file -/mnt/datastore/Telechargements/transmission-home/transmission-telegram.log on your host you would change add a volume mount like this

docker run --name transmission-telegram -v /mnt/datastore/Telechargements/transmission-home/transmission-telegram.log:<where your host file will be mounted inside the docker file system> kevinhalpin/transmission-telegram -token=<token> -master=nicolaslhomme -url=http://172.29.137.184:9091/transmission/rpc --logfile=<The location of the file within the docker filesystem you mounted earlier >

I dont know your filesystem and I havent used the --log functionality ever before but by running this command i was able to mount a folder within the container which then the --log-file argument would be able to reference

Did this to check filesystem

docker run -v /home/khalpin11/config/transmission-telegram:/transmission-telegram-home  --entrypoint /bin/sh  -it transmission-telegram:latest

ls -lah /

Screen Shot 2021-01-10 at 4 16 41 PM

So I hope this makes some sense Im not great at explaining things but give that a go

docker run --name transmission-telegram -v /mnt/datastore/Telechargements/transmission-home/transmission-telegram.log:/transmission-home/transmission-telegram.log kevinhalpin/transmission-telegram -token=<token> -master=nicolaslhomme -url=http://172.29.137.184:9091/transmission/rpc --logfile=/transmission-home/transmission-telegram.log

@kevinhalpin
Copy link
Contributor

for reference this is what those .env vars translated too back in the day when I ran it like this

telegram-transmission-bot:
  command: -token=<token> -master=khalpin11
    -url=http://192.168.1.100:9091/transmission/rpc -username=<user> -password=<pass>
  container_name: telegram-transmission-bot
  image: kevinhalpin/transmission-telegram:latest
  networks:
    kevBridge: null

transmission:
  container_name: transmission
  depends_on:
    plex:
      condition: service_started
    syncthing:
      condition: service_started
  environment:
    PGID: '69'
    PUID: '1041'
  hostname: transmission
  image: linuxserver/transmission
  network_mode: host
  volumes:
  - /srv/dev-disk-by-label-ssd/ssd/docker/config:/config:rw
  - /srv/dev-disk-by-label-8tb/kevData:/kevData:rw

hope this helps. I mainly use qBitorrent now so I no longer run this add on.

@nlhomme
Copy link
Author

nlhomme commented Jan 11, 2021

Ok I got it, the -v option was the key!

Here is my final command:

docker run --name transmission-telegram -v /mnt/datastore/Telechargements/transmission-home/:/transmission-home/  kevinhalpin/transmission-telegram -token=<token> -master=nicolaslhomme -url=http://172.29.137.184:9091/transmission/rpc --logfile=/transmission-home/transmission-telegram.log --transmission-logfile=/transmission-home/transmission.log

Especially that part:

(...) -v /mnt/datastore/Telechargements/transmission-home/:/transmission-home/ (...)

The local file system is now mounted in my container:

root@proliant:[/mnt/datastore/Telechargements]|20:08:47|# docker exec -it 05e01ee94b01 ls -lh /transmission-home/
total 36
drwxr-sr-x    2 root     1000        4.0K Dec 30 23:18 blocklists
-rw-------    1 root     1000        1.2K Jan  8 19:16 dht.dat
drwxr-sr-x    2 root     1000        4.0K Jan 11 19:05 resume
-rw-------    1 root     1000        2.3K Jan  8 19:17 settings.json
-rw-------    1 root     1000         158 Jan 11 19:05 stats.json
drwxr-sr-x    2 root     1000        4.0K Jan 11 19:04 torrents
drwxr-sr-x    2 root     root        4.0K Jan 11 18:52 transmission
-rw-r--r--    1 root     1000        1.4K Jan 11 19:08 transmission-telegram.log
-rw-r--r--    1 root     1000        4.0K Jan 11 19:07 transmission.log

The container now work the way I want, thank you very much!

@nlhomme nlhomme closed this as completed Jan 11, 2021
@nlhomme
Copy link
Author

nlhomme commented Jan 11, 2021

I reopen this issue, I think that the wiki or the readme should be updated to include how to mount the local file system when you set the log files, I'm probably not the only one who that kind of issue happens, especially when you're not a docker specialist

@nlhomme nlhomme reopened this Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants