question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] walinuxagent does not read environment variable PATH

See original GitHub issue

I updated the PATH variable on my VM, but the walinuxagent seems not to pick up the changes, and uses and odd value for it. Steps followed:

  • update system-wide PATH by modifying /etc/environment
  • restart the VM

If I ssh into the machine and perform the following commands:

  • sudo su (to impersonate the user root)
  • echo $PATH the returned value is correct.

If I execute echo $PATH in Azure Portal through the ‘Run command’ panel of the VM, a different value is returned in the output (different even from the one before I made the change). I also executed the commands whoami (to be sure I am using the same user root in both cases) and more /etc/environment (to check that the right value is still there). I tried to re-install and restart the agent, but not difference in the outcome.

  • Distro and Version: Ubuntu 16.04 (Data Science Machine)
  • WALinuxAgent version. Output of waagent --version: WALinuxAgent-2.2.32.2 running on ubuntu 16.04 Python: 3.5.2 Goal state agent: 2.2.40

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vrdmrcommented, Nov 5, 2019

My hypothesis is that the later two path variables (/usr/games:/usr/local/games) were added after the service (/usr/bin/python3 -u /usr/sbin/waagent -daemon) started. And the service never got it (becuase of our configuration of the unit file - eg: Ubuntu does not have environment key in the service section.)

This is an issue, especially if the environment variables are not being picked up. I will test it with 18.04 VMs as well.

0reactions
stawocommented, Nov 18, 2019

@vrdmr , thanks a lot for the hard work! Hope 18.04 doesn’t show this behavior and that the Data Science Machine will be updated to that version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cloud-init does not appear to be running error after installing ...
Decided to create a blank Linux VM to see the agent configuration of it, within /var/lib/waagent folder there was ovf-env.xml – had a...
Read more >
Azure Devops - Environment variable $Path is overwritten via ...
This line of code set the environment variable $env:Path!!!! So now Azure Devops can't find any executables. I get this error message.
Read more >
Unable to configure the PATH environment variable in Kudu ...
I have seen posts like setting the webapp %PATH% environment variable in azure. The post recommends adding a file called applicationHost.xdt to ...
Read more >
Chapter 6. RHEL 8.1.0 release Red Hat Enterprise Linux 8
Network drivers typically read multiple PCI registers, and the driver does not read the lowest bits of the PHC time stamp between two...
Read more >
Custom Azure VM Scale Sets with Terraform and Cloud Init
Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found