Created 10-20-2023 11:39 AM
Hi,
I have been using the cdswctl tool for a while for creating sessions that can be accessed by VS Code from Windows.
Today i tried to create a session from a Mac using the same command and it throws an error complaining that the API key is not valid. I have checked the key and same key works fine from Windows.
The command i am using is :
./cdswctl login -n USERNAME -u http://cdsw.mydomain.xxxx/ -y APIKEY
Can anyone offer any advice?
Thanks
Created 11-02-2023 04:17 AM
So - it is related to proxy/dns settings when on RAS.
Adding a lookup to etc/hosts from the IP address to the Host name has fixed my issue:
e.g.
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.99.90.1 cdsw.XXXXXX.xxxx
Created 10-20-2023 03:02 PM
@BubbaBoBobBrain Welcome to the Cloudera Community!
To help you get the best possible solution, I have tagged our CDSW experts @Gopinath @Mike who may be able to assist you further.
Please keep us updated on your post, and we hope you find a satisfactory solution to your query.
Regards,
Diana Torres,Created on 10-27-2023 04:36 AM - edited 10-27-2023 04:36 AM
Hi - i am still facing a blocker on this. Can anyone offer any advice?
A colleague with a Mac has also tried and they get the same error:
Failed to authenticate for user <my user name> using provided API key.
Could it be due to case of the usernames? In CDSW my username is uppercase and on my mac it is lower case?
I have tried putting my username in the login statement matching the case of my CDSW user.
Created 10-27-2023 09:11 AM
@Scharan Any insights here? Thanks!
Regards,
Diana Torres,Created 10-30-2023 06:47 AM
Hi @BubbaBoBobBrain , you need to include the workspace in your login command, see this page: https://docs.cloudera.com/cdsw/1.10.3/cli-reference/topics/cdsw-login-cdswctl.html
This command worked fine for me:
./cdswctl login -u https://mikes-cdsw.cloudera.com -n mike -y u8ryf6a2977rfsr8zajesand2jhwoa44
Btw on Mac you usually need to first right click on the cdswcli icon and select "Open" - this will let you open the tool once which lets your mac system trust the application, which it won't do by default since it was downloaded from the internet. After this you can use it as normal.
Created 10-31-2023 02:30 AM
Hi @Mike ,
Thank you for the reply.
I have already trusted the the cdswctl application.
I can't see much difference between my command and yours?
The error i am getting is related to the API key. If i remove the API key it prompts me for a password but then fails as we used SSO.
Created 10-31-2023 03:58 AM
Oh weird the first time I read this I didn't see you using the server anywhere. No, the command you are using is correct.
Can you expand on this statement?
>Could it be due to case of the usernames? In CDSW my username is uppercase and on my mac it is lower case?
The username you are using in the command is the CDSW username, not your mac username.
Created 10-31-2023 05:05 AM
My Mac logon, home dir and the username at the end of the SSH public key is as follows:
a1234567
But in CDSW the username is:
A1234567
I didn't know if this would cause a conflict? I have tried both A1234567 and a1234567 in the login statement.
Created 10-31-2023 05:12 AM
I am in the office now rather than working remotely via VPN and it has worked ok. 😃
I will try again at home later and see if the VPN was causing an issue.
Created 10-31-2023 06:38 AM
I would expect that you need to use A1234567 as that will be the username which matches the API key.
If the only thing that changed was the VPN... that must be the issue. Perhaps the VPN is blocking ssh access or rewriting some header or something? I'm pretty sure that the error about an invalid API key is not the real error - it likely cannot even get to your CML in the first place. When you get back on VPN, can you try to just cURL your server with and without VPN?