azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

`az container exec` fails using PATH of non-root

Open martinvelos opened this issue 7 years ago • 7 comments

Describe the bug To a Jenkins container az container exec --exec-command 'bash -c java -h' --resource-group mygroupp --name jenkifriend returns rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"bash -c java -h\": executable file not found in $PATH".

To Reproduce az container create --resource-group mygroupp --name jenkifriend --image jenkins/jenkins --ports 8080 5000 --dns-name-label $DNS_NAME_LABEL --location eastus When ready, try the command above an see.

Expected behavior print whatever java -h does, when in shell that container exec --exec-command 'bash' does.( This two-step way does what expected.)

Environment summary This one obtained by pipsi, but I have the same issue with basic pip or dnf. azure-cli (2.0.57) Fedora 29, bash

Additional context Does with any more complex command, even az container exec --exec-command 'bash -c whoami'..

martinvelos avatar Mar 05 '19 15:03 martinvelos

Hey,

having same issues with "az container exec". Tried to run python command with parameters:

user1@Azure:~$ az container exec -g RG --name images1 --container-name images1 --exec-command "command.py -t some_parameter" rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"command.py -t some_parameter\": executable file not found in $PATH"

If I try to add $(pwd) in the path for command it takes my machines local directory not the container's one:

user1@Azure:~$ az container exec -g RG --name images1 --container-name images1 --exec-command "$(pwd)/command.py -t some_parameter" rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"/home/user1/command.py -t some_parameterl\": stat /home/user1/command.py -t some_parameter: no such file or directory"

texnokot avatar Jun 17 '19 22:06 texnokot

container

yonzhan avatar May 02 '20 13:05 yonzhan

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dkkapur.

ghost avatar Jun 16 '20 06:06 ghost

@martinvelos Apologies for the delayed response. This GitHub issue has been open for quite some time. Could you please let us know if you still facing this issue and need assistance? Awaiting your reply.

SaurabhSharma-MSFT avatar Feb 08 '22 02:02 SaurabhSharma-MSFT

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Feb 15 '22 08:02 ghost

Hi,

Romulo is no longer working with us. But possibly @Ugur Bayazit can follow up. Have you reached out to Ugur already??

Kind Regards, Frederik


From: msftbot[bot] @.> Sent: Tuesday, February 15, 2022 09:01 To: Azure/azure-cli @.> Cc: Rômulo Furtado @.>; Manual @.> Subject: Re: [Azure/azure-cli] az container exec fails using PATH of non-root (#8687)

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

— Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-cli%2Fissues%2F8687%23issuecomment-1039971200&data=04%7C01%7Ctylleman%40debitos.com%7C57419281392e4c811b1108d9f059572e%7C7f13d7abd4d343d08ebcae090a128784%7C0%7C0%7C637805088801930244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=wwAhoSSbFmo%2FuUdaIVAQdm5ZZNFMrnXNjJ%2FWJR4CshU%3D&reserved=0, or unsubscribehttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANXWVNPT5IQX3AFYSV5MBFLU3IB4VANCNFSM4G33NJMQ&data=04%7C01%7Ctylleman%40debitos.com%7C57419281392e4c811b1108d9f059572e%7C7f13d7abd4d343d08ebcae090a128784%7C0%7C0%7C637805088801930244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=6xyGFQ6ktnRIhZcjwy%2FDzim5B%2F%2BiU1Xj%2FO7ydhEn9Oc%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctylleman%40debitos.com%7C57419281392e4c811b1108d9f059572e%7C7f13d7abd4d343d08ebcae090a128784%7C0%7C0%7C637805088801930244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=WOX7g6SWOAOT%2FVAn5LJOxI3MSwqqekl2VH5GDvEE13g%3D&reserved=0 or Androidhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Ctylleman%40debitos.com%7C57419281392e4c811b1108d9f059572e%7C7f13d7abd4d343d08ebcae090a128784%7C0%7C0%7C637805088801930244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=7TPoCjxMgWBfagAPNUVJ2QMPG6BgRYtlOGpsGtPeplo%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

romulo-dbts avatar Feb 15 '22 08:02 romulo-dbts

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Feb 22 '22 14:02 ghost