[PR #979] [MERGED] fix: remove previous socket file to prevent bind error #519

Closed
opened 2025-10-08 00:12:12 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/979
Author: @Caian
Created: 9/24/2025
Status: Merged
Merged: 9/24/2025
Merged by: @stonith404

Base: mainHead: issue/remove_previous_socket


📝 Commits (1)

  • db2024e Remove previous socket file to prevent bind error

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 backend/internal/bootstrap/router_bootstrap.go (+1 -0)

📄 Description

Unix sockets cannot be created if the file already exists. The current socket file can be left behind if pocket-id closes ungracefully, either because of a crash or if the system loses power.

In those cases pocket-id fails to restart with the following error:

failed to init router: failed to create unix listener: listen unix /pocketid/pocketid.sock: bind: address already in use

This PR removes the previous socket file, if it exists, before creating the router.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/979 **Author:** [@Caian](https://github.com/Caian) **Created:** 9/24/2025 **Status:** ✅ Merged **Merged:** 9/24/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `issue/remove_previous_socket` --- ### 📝 Commits (1) - [`db2024e`](https://github.com/pocket-id/pocket-id/commit/db2024e7cf22117ad9c7be029ce96aed8921a754) Remove previous socket file to prevent bind error ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/bootstrap/router_bootstrap.go` (+1 -0) </details> ### 📄 Description Unix sockets cannot be created if the file already exists. The current socket file can be left behind if pocket-id closes ungracefully, either because of a crash or if the system loses power. In those cases pocket-id fails to restart with the following error: > failed to init router: failed to create unix listener: listen unix /pocketid/pocketid.sock: bind: address already in use This PR removes the previous socket file, if it exists, before creating the router. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-08 00:12:12 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#519