Skip to content
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

Airflow SalesforceHook empty security token #23910

Closed
2 tasks done
parvezmkhan opened this issue May 25, 2022 · 4 comments
Closed
2 tasks done

Airflow SalesforceHook empty security token #23910

parvezmkhan opened this issue May 25, 2022 · 4 comments
Labels

Comments

@parvezmkhan
Copy link

Apache Airflow version

2.2.2

What happened

When creating salesforce hook like below get
sf = SalesforceHook(salesforce_conn_id="test_sf")

Get below TypeError
You must provide login information or an instance and token

This is test salesforce domain.
User name and password are set correctly in Airflow connection but security token is not filled.
I expect the connection to setup without error

What you think should happen instead

Changing

security_token=extras.get('extra__salesforce__security_token') or None,

to below works, i.e. connection is established
security_token=extras["extra__salesforce__security_token"] or '',

How to reproduce

Setup salesforce connection in airflow with

  • user name, password and no security token
  • domain : test
  • API version : 54.0

Operating System

macOS 11.2.3

Versions of Apache Airflow Providers

apache-airflow-providers-salesforce 3.3.0
simple-salesforce 1.11.4

Deployment

Virtualenv installation

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@parvezmkhan parvezmkhan added area:core kind:bug This is a clearly a bug labels May 25, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented May 25, 2022

Thanks for opening your first issue here! Be sure to follow the issue template!

@eladkal
Copy link
Contributor

eladkal commented May 25, 2022

You are using apache-airflow-providers-salesforce 3.3.0 which is out of date.
Check the changelog version 3.4.0 included
Do not require all extras for SalesforceHook (#19530)

@eladkal eladkal closed this as completed May 25, 2022
@eladkal eladkal added invalid and removed kind:bug This is a clearly a bug area:core labels May 25, 2022
@parvezmkhan
Copy link
Author

@eladkal
Thanks a lot for looking into this.

I upgraded to 3.4.4 as shown below
`
pip install --upgrade apache-airflow-providers-salesforce==3.4.4

pip show apache-airflow-providers-salesforce
Name: apache-airflow-providers-salesforce
Version: 3.4.4
`

After running, still get same error
sf = SalesforceHook(salesforce_conn_id="test_sf") ... TypeError: You must provide login information or an instance and token
Am I doing something wrong?

Thanks!

@eladkal
Copy link
Contributor

eladkal commented May 26, 2022

Please follow
https://airflow.apache.org/docs/apache-airflow-providers-salesforce/stable/connections/salesforce.html

There are different types of authentication to salesforce. Make sure you are following the insteuctions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants