Azure-storage-azcopy: Login fails with "failed to get keyring" on WSL

Created on 18 Jan 2019  路  6Comments  路  Source: Azure/azure-storage-azcopy

Which version of the AzCopy was used?

Note: The version is visible when running AzCopy without any argument

AzCopy 10.0.5-Preview

Which platform are you using? (ex: Windows, Mac, Linux)

Ubuntu 18.04 on Windows Subsystem for Linux, Windows 10 build 18312

What command did you run?

Note: Please remove the SAS to avoid exposing your credentials. If you cannot remember the exact command, please retrieve it from the beginning of the log file.

azcopy login

What problem was encountered?

After authenticating through https://microsoft.com/devicelogin with the authentication code (which shows success), login fails with error

 Error: failed to perform login command, failed to get keyring during saving token, function not implemented

How can we reproduce the problem in the simplest way?

  • Install Ubuntu from Windows store
  • Open it, download azcopy from https://aka.ms/downloadazcopy-v10-linux and unpack
  • Run azcopy login, go through the prompts

Have you found a mitigation/solution?

No, tried installing a keyring through sudo apt install gnome-keyring but that did not solve the problem.

enhancement

Most helpful comment

I ran into a similar azcopy issue in a Docker Container.

Which version of the AzCopy was used? azcopy v10.2.1
Which platform are you using? RHEL7.x and Docker Container
What command did you run? azcopy login --service-principal --certificate-path
What problem was encountered?
Failed to perform login command:
failed to get keyring during saving token, operation not permitted

Have you found a mitigation/solution?
The container was running with "seccomp". The quickest resolution is to run the image with "seccomp" disabled. See link for resolution: https://docs.docker.com/engine/security/seccomp/

I also needed to "yum install keyutils".
I am able to "azcopy login" with a service principal that has a public certificate in a docker container.

All 6 comments

Hi, caksoylar

Thanks for reaching us! We will further test your scenario. And will update the thread later.

Best Regards,
Jiachen

Hi, @caksoylar

AzCopy on Linux is using Linux embedded keyring, while we can repro your issue, that on Ubuntu 18.04 on Windows Subsystem for Linux, even with keyctl, keyring cannot be used properly, e.g.:

root@MS-JIACFAN-PC6:/mnt/c# keyctl list @s
keyctl_read_alloc: Function not implemented

Would you try to use it on standard Linux distro? At same time, we'll discuss and consider to add support for Ubuntu 18.04 on Windows Subsystem for Linux.

Thanks,
Jiachen

Thanks for the investigation and reply @jiacfan, sorry to hear this is a shortcoming of WSL. I don't have a real Linux system to test on, but I'll try to do my work with azcopy on Windows until a solution can be found.

@caksoylar

Thanks for updating the info!

I ran into a similar azcopy issue in a Docker Container.

Which version of the AzCopy was used? azcopy v10.2.1
Which platform are you using? RHEL7.x and Docker Container
What command did you run? azcopy login --service-principal --certificate-path
What problem was encountered?
Failed to perform login command:
failed to get keyring during saving token, operation not permitted

Have you found a mitigation/solution?
The container was running with "seccomp". The quickest resolution is to run the image with "seccomp" disabled. See link for resolution: https://docs.docker.com/engine/security/seccomp/

I also needed to "yum install keyutils".
I am able to "azcopy login" with a service principal that has a public certificate in a docker container.

Thanks for sharing that info @sac8m!

Was this page helpful?
0 / 5 - 0 ratings