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

wf_set_key results in error message #34

Closed
jwagemann opened this issue Apr 29, 2019 · 15 comments
Closed

wf_set_key results in error message #34

jwagemann opened this issue Apr 29, 2019 · 15 comments
Labels
question Further information is requested

Comments

@jwagemann
Copy link

If I try to set my webapi or cds key with wf_set_key, I get the following error:

... unused argument (email = "EMAILADDRESS")

Also, if I try to manually set the key, I get the following error message:
Error in wf_set_key(service = "webapi") :
Could not validate login information.

This happens with both, webapi and cds service.
Any advice?

@khufkens
Copy link
Member

khufkens commented Apr 29, 2019

syntax should be:

for CDS (ID based):

wf_set_key(user = "2055", key = "somekey", service = "cds")

for ECMWF (email based):

wf_set_key(user = "test@mail.com", key = "somekey", service = "webapi")

There should be any reference to an email argument. Best to use the CLI data entry approach (as it also hides copy paste items from your history):

> wf_set_key(service = "cds")
Login or register to get a key
User ID / email: 2088
API key: 3 ... f
User 2088 for cds service added successfully

Remember that for the CDS service you should use the user ID (a number) not your email address, while for the webapi it is your email address (rather inconsistent but outside my control).

Let me know if this helps. Also, could you mention the system used? I have little access to Windows machines for testing, so results are skewed towards OSX and Linux.

@khufkens
Copy link
Member

Also, beware of copying spaces " " when using keys. These sneak in and create bad credentials without being too obvious.

@jwagemann
Copy link
Author

Thanks, it works for the cds now, but not for webapi, I still get the same error. I am on OSX. Will try a bit further and let you know. Thanks for your prompt reply.

@khufkens
Copy link
Member

In case of the webapi don't copy the quotation marks, they are ingested as part of the key if you use the command line entry. I'm not sure how the keys are generated (and I assume they will never include ") but since I'm not sure I don't kick them out by default.

@jwagemann
Copy link
Author

jwagemann commented Apr 29, 2019

Hey,
it worked with the account registered on my private email at ECMWF. But the account with the ecmwf email has some restrictions, it seems.

@khufkens
Copy link
Member

I'm not sure why you are locked out using the internal email. Seems that if you could login to the page you are redirected to you should be able to use the API with this account as well. Maybe the two are separated on another level. Best to ask around on your side, I've far less insight into this.

@jwagemann
Copy link
Author

It's fine. Thanks. I can use the account on my private email address for now. I'll check here to find out possible reasons for getting logged out with the internal email.

@khufkens
Copy link
Member

Ok. Let me know if you hit other issues. I'm leaving this open and pinned as this might help others although resolved.

@khufkens khufkens pinned this issue Apr 29, 2019
@jwagemann
Copy link
Author

I'd suggest updating the README and doc, as there you still use email for the function wf_set_key.

@khufkens
Copy link
Member

khufkens commented Apr 29, 2019

Ah, that's the source of confusion!

This has been fixed in the new website / readme: https://github.com/khufkens/ecmwfr

@khufkens khufkens added the question Further information is requested label May 2, 2019
@khufkens khufkens closed this as completed May 2, 2019
@cckgl
Copy link

cckgl commented Mar 18, 2021

To download from the CDS, I am running (with my personal user number and key from my profile):
wf_set_key(user = "1234",
key = "somekey",
service = "cds")

  • User 78783 for cds service added successfully in keychain

However, when running:
wf_get_key(user = "1234")

  • Error in b_macos_get(self, private, service, username, keyring) :
    keyring error (macOS Keychain), cannot get password: The specified item could not be found in the keychain.

Do you have any advice?
Thanks a lot in advance

@khufkens
Copy link
Member

khufkens commented Mar 18, 2021

You need to specify the service.

The default iswebapi which you did not set.

wf_get_key(user = "1234", service = "cds") should work.

@hydrovorobey
Copy link

Hi! Getting same validation error with my account with wf_get_key(user = cds_user, service = "cds"). wf_get_key(user = cds_user, service = "cds") also drops an error (Error in b_wincred_i_get(target) : Windows credential store error in 'get': Element not found). Triple checked creds - they re correct. I thought maybe there are problems with account, but manual data request on website works ok... any ideas?

@khufkens
Copy link
Member

Could you provide session info please sessioninfo::session_info() as well as the a reproducable example of the code used (with credentials hidden (xxx).

@hydrovorobey
Copy link

Could you provide session info please sessioninfo::session_info() as well as the a reproducable example of the code used (with credentials hidden (xxx).

seems like I found the problem and its nothing to do with the package - one of my account probably was blocked, since others continue working.

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

No branches or pull requests

4 participants