We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the app's configure.swift, func configure(), set to use Unix domain socket (UDS):
configure.swift
func configure()
app.http.server.configuration.address = .unixDomainSocket(path: unixDomainSocket)
If the UDS file exists then the app crashes upon start.
bind(descriptor:ptr:bytes:): Address already in use (errno: 98) (Vapor/Application.swift:162)
Vapor removes the old UDS file and recreates it. As per @gwynne on Discord, the bug is at https://github.com/vapor/vapor/blob/main/Sources/Vapor/HTTP/Server/HTTPServer.swift#L421:
channel = bootstrap.bind(unixDomainSocketPath: socketPath)
And the fix:
channel = bootstrap.bind(unixDomainSocketPath: socketPath, cleanupExistingSocketFile: true)
Tested working on my machine.
OS = Ubuntu 22.04 aarch64 Swift v5.9
{ "identity" : "vapor", "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/vapor.git", "state" : { "revision" : "036d67e4da46126810f56c6a6ce813bcf259a745", "version" : "4.84.1" } },
The text was updated successfully, but these errors were encountered:
@talmeme if you want to do a PR for this that would be great!
Sorry, something went wrong.
Delete socket file if it exists. Fixes vapor#3085.
5755b2c
No branches or pull requests
Describe the bug
In the app's
configure.swift
,func configure()
, set to use Unix domain socket (UDS):If the UDS file exists then the app crashes upon start.
To Reproduce
bind(descriptor:ptr:bytes:): Address already in use (errno: 98) (Vapor/Application.swift:162)
Expected behavior
Vapor removes the old UDS file and recreates it. As per @gwynne on Discord, the bug is at https://github.com/vapor/vapor/blob/main/Sources/Vapor/HTTP/Server/HTTPServer.swift#L421:
channel = bootstrap.bind(unixDomainSocketPath: socketPath)
And the fix:
channel = bootstrap.bind(unixDomainSocketPath: socketPath, cleanupExistingSocketFile: true)
Tested working on my machine.
Environment
OS = Ubuntu 22.04 aarch64
Swift v5.9
The text was updated successfully, but these errors were encountered: