[GH-ISSUE #943] invalid memory address or nil pointer dereference #661

Open
opened 2026-05-07 00:26:23 +02:00 by BreizhHardware · 2 comments

Originally created by @Altycoder on GitHub (Nov 10, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/943

Just installed in docker using compose and getting the following error (username, password and name obfuscated):

$ ntfy publish -u <user>:<password> https://ntfy.<domain>.com "fourth try"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xca72dd]

goroutine 1 [running]:
heckel.io/ntfy/cmd.defaultClientConfigFileUnix()
        /home/runner/work/ntfy/ntfy/cmd/subscribe.go:324 +0x1d
heckel.io/ntfy/cmd.defaultClientConfigFile(...)
        /home/runner/work/ntfy/ntfy/cmd/subscribe_unix.go:17
heckel.io/ntfy/cmd.loadConfig(0xef8560?)
        /home/runner/work/ntfy/ntfy/cmd/subscribe.go:313 +0x38
heckel.io/ntfy/cmd.execPublish(0xc000130d40)
        /home/runner/work/ntfy/ntfy/cmd/publish.go:87 +0x36
github.com/urfave/cli/v2.(*Command).Run(0x303cf00, 0xc000130d40, {0xc0003ca960, 0x5, 0x5})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:274 +0x9eb
github.com/urfave/cli/v2.(*Command).Run(0xc0001fe2c0, 0xc000130800, {0xc00012a120, 0x6, 0x6})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:267 +0xc4d
github.com/urfave/cli/v2.(*App).RunContext(0xc000378000, {0x29c80f8?, 0xc00012c000}, {0xc00012a120, 0x6, 0x6})
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:332 +0x616
github.com/urfave/cli/v2.(*App).Run(...)
        /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:309
main.main()
        /home/runner/work/ntfy/ntfy/main.go:32 +0x333
~ $ 

Docker compose:

  ntfy:
    image: binwiederhier/ntfy
    container_name: ntfy
    command:
      - serve
    environment:
      - TZ=${TZ}
    user: ${PUID}:${PGID}
    volumes:
      - ${DOCKER_DIR}/ntfy/cache:/var/cache/ntfy
      - ${DOCKER_DIR}/ntfy:/etc/ntfy
    ports:
      - 90:80
    restart: unless-stopped

Caddyfile (relevant portion):

ntfy.<domain>.com {
	reverse_proxy localhost:90
}
Originally created by @Altycoder on GitHub (Nov 10, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/943 Just installed in docker using compose and getting the following error (username, password and name obfuscated): ``` $ ntfy publish -u <user>:<password> https://ntfy.<domain>.com "fourth try" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xca72dd] goroutine 1 [running]: heckel.io/ntfy/cmd.defaultClientConfigFileUnix() /home/runner/work/ntfy/ntfy/cmd/subscribe.go:324 +0x1d heckel.io/ntfy/cmd.defaultClientConfigFile(...) /home/runner/work/ntfy/ntfy/cmd/subscribe_unix.go:17 heckel.io/ntfy/cmd.loadConfig(0xef8560?) /home/runner/work/ntfy/ntfy/cmd/subscribe.go:313 +0x38 heckel.io/ntfy/cmd.execPublish(0xc000130d40) /home/runner/work/ntfy/ntfy/cmd/publish.go:87 +0x36 github.com/urfave/cli/v2.(*Command).Run(0x303cf00, 0xc000130d40, {0xc0003ca960, 0x5, 0x5}) /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:274 +0x9eb github.com/urfave/cli/v2.(*Command).Run(0xc0001fe2c0, 0xc000130800, {0xc00012a120, 0x6, 0x6}) /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/command.go:267 +0xc4d github.com/urfave/cli/v2.(*App).RunContext(0xc000378000, {0x29c80f8?, 0xc00012c000}, {0xc00012a120, 0x6, 0x6}) /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:332 +0x616 github.com/urfave/cli/v2.(*App).Run(...) /home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.7/app.go:309 main.main() /home/runner/work/ntfy/ntfy/main.go:32 +0x333 ~ $ ``` Docker compose: ``` ntfy: image: binwiederhier/ntfy container_name: ntfy command: - serve environment: - TZ=${TZ} user: ${PUID}:${PGID} volumes: - ${DOCKER_DIR}/ntfy/cache:/var/cache/ntfy - ${DOCKER_DIR}/ntfy:/etc/ntfy ports: - 90:80 restart: unless-stopped ``` Caddyfile (relevant portion): ``` ntfy.<domain>.com { reverse_proxy localhost:90 } ```
Author
Owner

@Altycoder commented on GitHub (Nov 10, 2023):

Although this works:

curl -u <user>:<password> -d "test" https://ntfy.<domain>.com/<topic>
<!-- gh-comment-id:1805936200 --> @Altycoder commented on GitHub (Nov 10, 2023): Although this works: ``` curl -u <user>:<password> -d "test" https://ntfy.<domain>.com/<topic> ```
Author
Owner

@Altycoder commented on GitHub (Nov 10, 2023):

Same error with:

ntfy publish <topic> "another try"

or

ntfy publish -u <user>:<password> <topic> "another go"
<!-- gh-comment-id:1805943037 --> @Altycoder commented on GitHub (Nov 10, 2023): Same error with: ``` ntfy publish <topic> "another try" ``` or ``` ntfy publish -u <user>:<password> <topic> "another go" ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#661
No description provided.