haugene / docker-transmission-openvpn

Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
GNU General Public License v3.0
4.03k stars 1.2k forks source link

JSON parse failed (settings.json) #1212

Closed ghost closed 4 years ago

ghost commented 4 years ago

The problem I've been using Transmission-OpenVPN for a while now, but after an update or reboot it suddenly stopped working. For some reason, Transmisison is complaining about an invalid number in settings.json.

Docker run command

  transmission-vpn:
    container_name: transmission-vpn
    image: haugene/transmission-openvpn
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    restart: always
    dns:
      - 1.1.1.1
      - 1.0.0.1
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${USERDIR}/docker/transmission-vpn:/data
      - ${USERDIR}/docker/shared:/shared
      - ${USERDIR}/media/downloads:/data/watch
      - ${USERDIR}/media/downloads/completed:/data/completed
      - ${USERDIR}/media/downloads/incomplete:/data/incomplete
      - ${USERDIR}/config.ovpn:/etc/openvpn/custom/default.ovpn
    environment:
      - OPENVPN_PROVIDER=CUSTOM
      - OPENVPN_CONFIG=config
      - OPENVPN_USERNAME=xxxx
      - OPENVPN_PASSWORD=xxxx
      - OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60
      - LOCAL_NETWORK=192.168.87.0/24
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=true
      - TRANSMISSION_RPC_HOST_WHITELIST="127.0.0.1,192.168.*.*"
      - TRANSMISSION_RPC_PASSWORD=xxxx
      - TRANSMISSION_RPC_USERNAME=xxxx
      - TRANSMISSION_UMASK=002
      - TRANSMISSION_RATIO_LIMIT=1.00
      - TRANSMISSION_RATIO_LIMIT_ENABLED=true

Logs transmission.log [2020-05-28 18:36:45.571] transmission-daemon Error loading config file -- exiting. (daemon.c:825)

Docker logs

Using OpenVPN provider: CUSTOM
Supplied config config.ovpn could not be found.
Using default OpenVPN gateway for provider custom
Setting OPENVPN credentials...
adding route to local network xx.xx.xx.xx/24 via xx.xx.xx.xx dev eth0
Thu May 28 20:36:38 2020 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
Thu May 28 20:36:38 2020 library versions: OpenSSL 1.1.1  11 Sep 2018, LZO 2.08
Thu May 28 20:36:38 2020 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Thu May 28 20:36:38 2020 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Thu May 28 20:36:38 2020 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Thu May 28 20:36:38 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]46.166.143.98:1194
Thu May 28 20:36:38 2020 UDP link local: (not bound)
Thu May 28 20:36:38 2020 UDP link remote: [AF_INET]xx.xx.xx.xx:xx
Thu May 28 20:36:38 2020 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Thu May 28 20:36:38 2020 VERIFY OK: depth=1, C=CA, ST=ON, L=Toronto, O=Windscribe Limited, OU=Operations, CN=Windscribe Node CA
Thu May 28 20:36:38 2020 VERIFY KU OK
Thu May 28 20:36:38 2020 Validating certificate extended key usage
Thu May 28 20:36:38 2020 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Thu May 28 20:36:38 2020 VERIFY EKU OK
Thu May 28 20:36:38 2020 VERIFY OK: depth=0, C=CA, ST=ON, O=Windscribe Limited, OU=Operations, CN=Windscribe Node Server 4096
Thu May 28 20:36:38 2020 Control Channel: TLSv1.2, cipher TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384, 4096 bit RSA
Thu May 28 20:36:38 2020 [Windscribe Node Server 4096] Peer Connection Initiated with [AF_INET]46.166.143.98:1194
Thu May 28 20:36:45 2020 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu May 28 20:36:45 2020 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu May 28 20:36:45 2020 TUN/TAP device tun0 opened
Thu May 28 20:36:45 2020 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu May 28 20:36:45 2020 /sbin/ip link set dev tun0 up mtu 1500
Thu May 28 20:36:45 2020 /sbin/ip addr add dev tun0 xx.xx.xx.xx/xx broadcast xx.xx.xx.xx
Thu May 28 20:36:45 2020 /etc/openvpn/tunnelUp.sh tun0 1500 1553 xx.xx.xx.xx 255.255.254.0 init
Up script executed with tun0 1500 1553 xx.xx.xx.xx 255.255.254.0 init
Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of tun0 : xx.xx.xx.xx
Generating transmission settings.json from env variables
sed'ing True to true
Enforcing ownership on transmission config directories
Applying permissions to transmission config directories
Setting owner for transmission paths to 1000:1000
Setting permission for files (644) and directories (755)
Setting permission for watch directory (775) and its files (664)

-------------------------------------
Transmission will run as
-------------------------------------
User name:   abc
User uid:    1000
User gid:    1000
-------------------------------------

STARTING TRANSMISSION
NO PORT UPDATER FOR THIS PROVIDER
Transmission startup script complete.
Thu May 28 20:36:45 2020 Initialization Sequence Completed
[2020-05-28 18:36:45.570] JSON parse failed in /data/transmission-home/settings.json at pos 2213: INVALID_NUMBER -- remaining text "02,
    "upload-"

Host system: Ubuntu 18.04.4 LTS

xianoth commented 4 years ago

It seems we have opened up the same issue, on the same problem, on the same Host System Type, at the same time.

Dude, if we don't get an answer, I am just gonna be happy about the odds of this happening. :)

ghost commented 4 years ago

It seems we have opened up the same issue, on the same problem, on the same Host System Type, at the same time.

Dude, if we don't get an answer, I am just gonna be happy about the odds of this happening. :)

That's hilarious! :D

I hope someone can help us with the problem.

Did you change any of the settings in the WebUI before getting the issue?

sideshow-tech commented 4 years ago

I am getting this same error now, it started happening yesterday. I was going to post it as an issue, but got sidetracked.

xianoth commented 4 years ago

So, I did go into the config file to take a look. I couldn't see anything that looked out of place, but I didn't write it either. So I am sure there is something there that I missed. But yeah, same thing happened. Was working before i went to bed, woke up to no access to the WebUI. Spent a couple days thinking about it and then poked around. Fully removed the docker folder for transmission, figuring if there was a bad config file, maybe an old file is causing it. That didn't work either. Came to the github and saw that the container update 3 days ago and I was like.... "Ya know, that's about when it started for me" and here we are. It's been an adventure to be sure.

ghost commented 4 years ago

From the error code:

[2020-05-28 18:36:45.570] JSON parse failed in /data/transmission-home/settings.json at pos 2213: INVALID_NUMBER -- remaining text "02,
    "upload-"

It looks like it is this part of settings.json that's the problem: "upload-slots-per-torrent": 14, That's the only line that starts with "upload-".

xianoth commented 4 years ago

From the error code:

[2020-05-28 18:36:45.570] JSON parse failed in /data/transmission-home/settings.json at pos 2213: INVALID_NUMBER -- remaining text "02,
    "upload-"

It looks like it is this part of settings.json that's the problem: "upload-slots-per-torrent": 14, That's the only line that starts with "upload-".

Yep, same here. I changed the number, i checked the spacing looked for symbols out of place. Nada, all looks like it did before it stopped working.

pkishino commented 4 years ago

please read answer here: #1210 your umask is wrong TRANSMISSION_UMASK=002 is not valid for json, set this to TRANSMISSION_UMASK=2

pkishino commented 4 years ago

please close if issue is resolved

xianoth commented 4 years ago

Have verified this fixes the issue. Remade the container with the umask from 002 to just 2. Everything came up fine.