dbt-labs / tap-ringcentral

Singer.io tap for RingCentral
Apache License 2.0
5 stars 13 forks source link

400 Client Error: Bad Request for url: https://platform.ringcentral.com/restapi/oauth/token #4

Closed volodymyr-mykhailyk closed 4 years ago

volodymyr-mykhailyk commented 4 years ago

Hi There,

I was trying to configure RingCentral data replication on Stitch using this tap. Unfortunately, I'm receiving 400 errors on dev and production creds.

Here is the full log:

2019-12-31 10:39:26,177Z   main - INFO Running tap-ringcentral version 0.0.2 and target-stitch version 3.0.1
2019-12-31 10:39:26,252Z   main - INFO Starting tap to discover schemas: tap-env/bin/tap-ringcentral --config /tmp/tap_discover_config.json --discover
2019-12-31 10:39:26,726Z    tap - CRITICAL 400 Client Error: Bad Request for url: https://platform.ringcentral.com/restapi/oauth/token
2019-12-31 10:39:26,729Z    tap - Traceback (most recent call last):
2019-12-31 10:39:26,729Z    tap -   File "tap-env/bin/tap-ringcentral", line 8, in <module>
2019-12-31 10:39:26,729Z    tap -     sys.exit(main())
2019-12-31 10:39:26,729Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/singer/utils.py", line 192, in wrapped
2019-12-31 10:39:26,730Z    tap -     return fnc(*args, **kwargs)
2019-12-31 10:39:26,730Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_ringcentral/__init__.py", line 58, in main
2019-12-31 10:39:26,730Z    tap -     client = RingCentralClient(args.config)
2019-12-31 10:39:26,730Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_ringcentral/client.py", line 24, in __init__
2019-12-31 10:39:26,730Z    tap -     self.refresh_token, self.access_token = self.get_authorization()
2019-12-31 10:39:26,730Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_ringcentral/client.py", line 48, in get_authorization
2019-12-31 10:39:26,730Z    tap -     response.raise_for_status()
2019-12-31 10:39:26,730Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/requests/models.py", line 935, in raise_for_status
2019-12-31 10:39:26,730Z    tap -     raise HTTPError(http_error_msg, response=self)
2019-12-31 10:39:26,730Z    tap - requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://platform.ringcentral.com/restapi/oauth/token
2019-12-31 10:39:26,750Z   main - INFO Tap exited abnormally with status 1
2019-12-31 10:39:26,751Z   main - INFO No tunnel subprocess to tear down
2019-12-31 10:39:26,751Z   main - INFO Exit status is: Discovery failed with code 1 and error message: "400 Client Error: Bad Request for url: https://platform.ringcentral.com/restapi/oauth/token".

Could you please help me understand what is going wrong?

drewbanin commented 4 years ago

Hi @volodymyr-mykhailyk - it looks like the request that's failing is for

https://platform.ringcentral.com/restapi/oauth/token

It's super hard for me to say what the problem could be here. Are you able to contact Ringcentral support to find out more about the nature of these 400 errors? 400 typically means "Bad Request" and I do think this request is being made correctly, so it could be some sort of misconfiguration in your account? Hope this helps

volodymyr-mykhailyk commented 4 years ago

I understand what is failing but unfortunately, RingCentral is not showing these errors at all in their developer console. StitchData Is not helpfull as they simply redirect support to maintainers of tap.

I probably need to use this tap separately and see if I can debug correct configuration

volodymyr-mykhailyk commented 4 years ago

@drewbanin Figured out that credentials are wrong. Feel free to close the Issue. Added Pull request to help debug similar issues in the future