[BUG] Nix module's empty SSLKEYLOGFILE environment variable is breaking other software #300
Labels
No labels
bug
confirmed
contribution welcome
duplicate
enhancement
good first issue
help wanted
important
invalid
other
question
upstream
web compat
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celenity/Phoenix#300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Confirmation Checklist
Releasespage.What web browser(s) are you using with Phoenix?
Firefox Developer Edition
Other
No response
What operating system(s) are you experiencing this issue on?
NixOS
Other
No response
What version of Firefox/Gecko and Phoenix are you using?
152.0b1 (Phoenix: 2026.05.21.2)
If you remember, what version of Firefox/Gecko and Phoenix did you first notice the issue on?
No response
Does the issue occur on a new browser profile?
Please share your browser's distribution ID.
Not relevant here
Please share your browser's update channel.
Not relevant here
Please share a list of your currently installed browser add-ons/extensions, as well as the versions you have installed.
Not relevant here
Please explain the issue you are experiencing.
When the Phoenix NixOS module sets the environment variable
SSLKEYLOGFILEto an empty string, it causes runtime errors in Elixir and Erlang applications that use HTTP client libraries like Finch (which is the default in the Elixir Phoenix framework) or Req. These libraries try to open the file path inSSLKEYLOGFILEif it is set, even if it is empty. This results in a crash with a "could not open "": no such file or directory" error. The problem is not specific to Elixir but affects any software that expectsSSLKEYLOGFILEto be either unset or a valid file path.I've been debugging and quite frustrated for a long time today because my codebase was working the last time I touched that project 3 months ago (before installing Phoenix as a NixOS module), and suddenly it was throwing this cryptic error that I couldn't even find answers to online. I'm wondering if it's really necessary to set that environment variable, since if it causes problems in Elixir, I suppose it causes problems elsewhere, especially since it's empty?
Please provide detailed steps to reproduce the issue.
SSLKEYLOGFILEto an empty string in your environmentSSLKEYLOGFILEas a fileI don't really have another example to reproduce right now, sorry if this makes things more complicated. Please also let me know if you'd prefer I open an issue in the Finch repository; I'm not sure which would be more appropriate. Thanks in advance.
@amartin Thank you!
I've now made it so the environment variables are properly unset, instead of being set to an empty string. For Nix, based on the docs, I set
SSLKEYLOGFILE(and the other variables we want to unset) tonull- which should work to avoid issues like this.(On a side note, I really wish we could set environment variables for Firefox only - instead of setting them on the system level, but unfortunately I don't know of a reliable way that we can do that ATM).
IMO this is still worth reporting to Finch as well - they should probably add a check to ensure
SSLKEYLOGFILEis set to a valid file path before attempting to write to it.Thank you so much for the quick response and the fix!
I'll also report the issue to Finch. Cheers! :)