hrfee / jfa-go

a better way to manage your Jellyfin users, now in go

Home Page:https://jfa-go.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Failed to authenticate with Jellyfin | network is unreachable

LeviSnoot opened this issue · comments

commented

Describe the bug

When jfa-go starts on boot, it crashes due to some networking bug. I suspect it may try to start before Jellyfin has booted, as I can simply tell systemd to restart the service and after that it works fine.

To Reproduce

Hard to say, this config was working previously but one day this just started happening. Maybe I messed up the config somehow.

  1. Boot system
  2. Crash

Logs

-- Boot --
Jul 19 00:28:10 my-machine systemd[715]: Started jfa-go.service - An account management system for Jellyfin..
Jul 19 00:28:10 my-machine jfa-go[782]: 2023/07/19 00:28:10 Using internal storage
Jul 19 00:28:10 my-machine jfa-go[782]: jfa-go version: 0.4.0 (c6fc576)
Jul 19 00:28:10 my-machine jfa-go[782]: Socket: /tmp/jfa-go.sock
Jul 19 00:28:10 my-machine jfa-go[782]: [INFO] 00:28:10  Using Jellyfin server type
Jul 19 00:28:10 my-machine jfa-go[782]: main.go:436: Failed to authenticate with Jellyfin @ "https://obfuscated.url" (0): Post "https://obfuscated.url/Users/authenticatebyname": dial tcp: lookup obfuscated.url on 192.168.1.1:53: dial udp 192.168.1.1:53: connect: network is unreachable
Jul 19 00:28:10 my-machine jfa-go[782]: 2023/07/19 00:28:10
Jul 19 00:28:10 my-machine jfa-go[782]: ------
Jul 19 00:28:10 my-machine jfa-go[782]: A crash report has been saved to "/tmp/jfa-go-crash-2023-07-19T00:28:10.txt".
Jul 19 00:28:10 my-machine jfa-go[782]: ------
Jul 19 00:28:10 my-machine jfa-go[796]: Crash report for jfa-go
Jul 19 00:28:10 my-machine jfa-go[796]: Error: main.start:438 main.go:436: Failed to authenticate with Jellyfin @
Jul 19 00:28:10 my-machine jfa-go[796]: "https://obfuscated.url" (0): Post "https://obfuscated.url/Users/authenticatebyname":
Jul 19 00:28:10 my-machine jfa-go[796]: dial tcp: lookup obfuscated.url on 192.168.1.1:53: dial
Jul 19 00:28:10 my-machine jfa-go[796]: udp 192.168.1.1:53: connect: network is unreachable
Jul 19 00:28:10 my-machine jfa-go[796]: Create an Issue
Jul 19 00:28:10 my-machine jfa-go[796]: Full Log Copy
Jul 19 00:28:10 my-machine jfa-go[796]: Normal Sanitized
Jul 19 00:28:10 my-machine jfa-go[796]: 2023/07/19 00:28:10 Using internal storage
Jul 19 00:28:10 my-machine jfa-go[796]: jfa-go version: 0.4.0 (c6fc576)
Jul 19 00:28:10 my-machine jfa-go[796]: Socket: /tmp/jfa-go.sock
Jul 19 00:28:10 my-machine jfa-go[796]: [INFO] 00:28:10  Using Jellyfin server type
Jul 19 00:28:10 my-machine jfa-go[796]: main.go:436: Failed to authenticate with Jellyfin @ "https://obfuscated.url" (0): Post "https://obfuscated.url/Users/authenticatebyname": dial tcp: lookup obfuscated.url on 192.168.1.1:53: dial udp 192.168.1.1:53: connect: network is unreachable
Jul 19 00:28:10 my-machine jfa-go[796]: goroutine 1 [running]:
Jul 19 00:28:10 my-machine jfa-go[796]: runtime/debug.Stack()
Jul 19 00:28:10 my-machine jfa-go[796]:         /usr/local/go/src/runtime/debug/stack.go:24 +0x65
Jul 19 00:28:10 my-machine jfa-go[796]: main.Exit({0xc5e100, 0xc001f48af0})
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/exit.go:57 +0x2e5
Jul 19 00:28:10 my-machine jfa-go[796]: github.com/hrfee/jfa-go/logger.(*Logger).Fatalf(0xc000402480, {0xda7d1e, 0x34}, {0xc000533d38, 0x3, 0x3})
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/logger/logger.go:128 +0x135
Jul 19 00:28:10 my-machine jfa-go[796]: main.start(0x0, 0xcb)
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/main.go:436 +0x2925
Jul 19 00:28:10 my-machine jfa-go[796]: main.main()
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/main.go:753 +0x531
Jul 19 00:28:10 my-machine jfa-go[796]: An attempt has been made to remove sensitive info, but make sure to check
Jul 19 00:28:10 my-machine jfa-go[796]: yourself.
Jul 19 00:28:10 my-machine jfa-go[796]: 2023/07/19 00:28:10 Using internal storage
Jul 19 00:28:10 my-machine jfa-go[796]: jfa-go version: 0.4.0 (c6fc576)
Jul 19 00:28:10 my-machine jfa-go[796]: Socket: /tmp/jfa-go.sock
Jul 19 00:28:10 my-machine jfa-go[796]: [INFO] 00:28:10  Using Jellyfin server type
Jul 19 00:28:10 my-machine jfa-go[796]: main.go:436: Failed to authenticate with Jellyfin @ "CENSORED" (0): Post "CENSORED": dial tcp: lookup obfuscated.url on 192.168.1.1:53: dial udp 192.168.1.1:53: connect: network is unreachable
Jul 19 00:28:10 my-machine jfa-go[796]: goroutine 1 [running]:
Jul 19 00:28:10 my-machine jfa-go[796]: runtime/debug.Stack()
Jul 19 00:28:10 my-machine jfa-go[796]:         /usr/local/go/src/runtime/debug/stack.go:24 +0x65
Jul 19 00:28:10 my-machine jfa-go[796]: main.Exit({0xc5e100, 0xc001f48af0})
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/exit.go:57 +0x2e5
Jul 19 00:28:10 my-machine jfa-go[796]: github.com/hrfee/jfa-go/logger.(*Logger).Fatalf(0xc000402480, {0xda7d1e, 0x34}, {0xc000533d38, 0x3, 0x3})
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/logger/logger.go:128 +0x135
Jul 19 00:28:10 my-machine jfa-go[796]: main.start(0x0, 0xcb)
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/main.go:436 +0x2925
Jul 19 00:28:10 my-machine jfa-go[796]: main.main()
Jul 19 00:28:10 my-machine jfa-go[796]:         /drone/src/main.go:753 +0x531
Jul 19 00:28:10 my-machine systemd[715]: jfa-go.service: Main process exited, code=exited, status=1/FAILURE
Jul 19 00:28:10 my-machine systemd[715]: jfa-go.service: Failed with result 'exit-code'.

Configuration

config.ini

[jellyfin]
; settings for connecting to jellyfin
; it is recommended to create a limited admin account for this program.
username                    = Obfuscated
password                    = Obfuscated
; jellyfin server address. can be public, or local for security purposes.
server                      = http://local.url:port
; publicly accessible jellyfin address for invite form. leave blank to reuse the above address.
public_server               = https://obfuscated.url
; the name of the client that will show up in the jellyfin dashboard.
client                      = jfa-go
; timeout of user cache in minutes. set to 0 to disable.
cache_timeout               = 30
; note: emby integration works but is missing some features, such as password resets.
type                        = jellyfin
; optionally substitute occurrences of "jellyfin" in the account creation form and emails with this. may result in bad grammar.
substitute_jellyfin_strings = Obfuscated

jfa-go.service

[Unit]
Description=An account management system for Jellyfin.

[Service]
ExecStart=/usr/local/bin/jfa-go

[Install]
WantedBy=default.target

Platform/Version

  • Debian 12
  • Version 0.4.0, Commit c6fc576

I did note that issue #276 has similar output but it appears to be a different problem to my eyes.

Not sure if you still use jfa-go since its been so long, but f6fdd41 adds a retry mechanism, 6 attempts to connect to Jellyfin are made, 10 seconds apart. If this isn't long enough, its configurable in the advanced settings section.

commented

Didn't see this until now but yes, it's fixed. Thanks! (also the new password reset options are a godsend 👏)