You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: OAuth Authentication Fails in GitHub Action Pipeline
Description:
I am trying to use OAuth Authentication for schemachange in my GitHub Action pipeline but encounter the following error message:
Traceback (most recent call last):
File "/opt/actions-runner/_work/_tool/Python/3.8.18/x64/bin/schemachange", line 8, in <module>
sys.exit(main())
File "/opt/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 1309, in main
deploy_command(config)
File "/opt/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 601, in deploy_command
session = SnowflakeSchemachangeSession(config)
File "/opt/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 283, in __init__
if self.set_connection_args():
File "/opt/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 372, in set_connection_args
oauth_token = self.get_oauth_token()
File "/opt/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 329, in get_oauth_token
"url": self.oauth_config["token-provider-url"],
TypeError: 'NoneType' object is not subscriptable
This suggests that the oauth_config is not being correctly passed or is None. However, I have verified that the required environment variables are correctly set and passed in the GitHub Actions pipeline.
Steps to Reproduce:
I have the following GitHub Actions pipeline configured:
I have also confirmed that a separate Python script using the same credentials works to authenticate and connect to Snowflake (in the pipeline). Here’s the relevant Python code that works:
It appears that the schemachange OAuth config is not parsing the environment variables correctly. I suspect the issue might be related to how the OAuth config is being passed within schemachange.
Additional Information:
Here's the config file I’m using with schemachange:
Can someone please provide guidance on what might be causing the issue? Specifically, it seems like schemachange is unable to parse the OAuth configuration properly in the GitHub Actions pipeline.
The text was updated successfully, but these errors were encountered:
@Masoud-Ghodrati I ran into the same problem myself. When I looked at the code for how the cli is grabbing the config I found that the property in the yml file needs to be oauth_config instead of oauthconfigThe CLI line in question
Once I made that change in my schemachange-config.yml the github action started working 😄
I opened PR #286 to fix this so hopefully a maintainer will merge it
@Masoud-Ghodrati I ran into the same problem myself. When I looked at the code for how the cli is grabbing the config I found that the property in the yml file needs to be oauth_config instead of oauthconfigThe CLI line in question
Once I made that change in my schemachange-config.yml the github action started working 😄
I opened PR #286 to fix this so hopefully a maintainer will merge it
Thanks @herakilla for this, I can't believe my eyes didn't caught this differece.
It seems it's getting the config now, however I have another issue, which is not related to this but it's related to schemachange. I get this error now:
I don't know why I need -u $SF_USERNAME when I use oauth. It should work without username as far as I understand.
Issue: OAuth Authentication Fails in GitHub Action Pipeline
Description:
I am trying to use OAuth Authentication for
schemachange
in my GitHub Action pipeline but encounter the following error message:This suggests that the
oauth_config
is not being correctly passed or isNone
. However, I have verified that the required environment variables are correctly set and passed in the GitHub Actions pipeline.Steps to Reproduce:
Potential Cause:
It appears that the
schemachange
OAuth config is not parsing the environment variables correctly. I suspect the issue might be related to how the OAuth config is being passed withinschemachange
.Additional Information:
Here's the config file I’m using with
schemachange
:Request for Help:
Can someone please provide guidance on what might be causing the issue? Specifically, it seems like
schemachange
is unable to parse the OAuth configuration properly in the GitHub Actions pipeline.The text was updated successfully, but these errors were encountered: