-
-
Couldn't load subscription status.
- Fork 399
Fix environment variable parsing in get_integer function #1519
New issue
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
Conversation
|
@Fudster is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
Amazing, LFG! |
|
Just discovered another related bug while testing this fix! 🐛 The script was also failing with: This was happening because the script tries to check Fixed it by using bash parameter expansion: # Before
if [[ -n "${GENERATE_CLUSTER_CERTS}" ]] ; then
# After
if [[ -n "${GENERATE_CLUSTER_CERTS:-}" ]] ; thenThe |
|
ended up implementing the fixes in #1520 to guarantee all workflows would work |
Disappointed this wasn't approved due to a flawed(?) review process. I had other work planned but reconsidering now, I was going to work on the handle_out issue with the external ID, but not sure anymore. |
|
I understand the frustration and it's kind of shitty at the moment ... let me actually check with the team how we can improve it as it's not very contribution friendly. mainly two points that we need to revise:
let me check with the team if we are able to have quick wins that improve this |
Valid points. A couple of potential solutions: For the mix.exs bumping: For conventional commits: |
16e18b3 to
841625e
Compare
|
will share this solution with team |

Fix environment variable parsing in get_integer function
Updated the get_integer function to properly convert the environment variable value to an integer instead of using the variable name. This change ensures the correct value is processed.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
The application crashes during boot in Kubernetes environments with the following error:
The issue occurs because
String.to_integer(env)was being called with the environment variable name "PORT" instead of its actual value. This causesbinary_to_integerto fail when trying to convert the literal string "PORT" to an integer.What is the new behavior?
The
get_integerfunction now correctly callsString.to_integer(value)wherevaluecontains the actual environment variable value (e.g., "4000") rather than the variable name. This allows the application to boot successfully in Kubernetes environments.Additional context
This bug only manifested in Kubernetes deployments and was not reproducible in Docker environments, likely due to differences in how environment variables are handled or set between the two container orchestration platforms.I forgot to rebuild the image, so the bug also appears locally on Docker too. The fix ensures consistent behavior across all deployment environments.Update: Also discovered and fixed another related bug with
GENERATE_CLUSTER_CERTSenvironment variable handling. The script was failing with "unbound variable" error when this optional variable wasn't defined. I didn't notice this before because I had it defined in Kubernetes and didn't rebuild the Docker image locally. Fixed by using bash parameter expansion${GENERATE_CLUSTER_CERTS:-}to handle the optional variable gracefully.