Inconsistent Landscape remote script execution

Ubuntu Version: 22.04 LTS

Desktop Environment: GNOME (default)

Problem Description: Running scripts from Landscape is not working properly. This is a brand new installation and shouldn’t expect this kinds of issues.

I’m trying to find some documentation on how to troubleshoot this, but couldn`t find any. Where can I find this information?

A simple script is delivered, but it keeps running for very long time, and then fails.

image

Relevant System Information:

image

Screenshots or Error Messages:

image

The output text:

Upon execvpe /tmp/tmphd6f7y_d ('/tmp/tmphd6f7y_d',) in environment id 130460588954496
:Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 397, in _fork
    self._execChild(path, uid, gid, executable, args, environment)
  File "/usr/lib/python3/dist-packages/twisted/internet/process.py", line 468, in _execChild
    os.execvpe(executable, args, environment)
  File "/usr/lib/python3.10/os.py", line 584, in execvpe
    _execvpe(file, args, env)
  File "/usr/lib/python3.10/os.py", line 598, in _execvpe
    exec_func(file, *argrest)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmphd6f7y_d'

Hi,

Just to be clear, I do not use Landscape or even really know much about it.

That said, I tried to do some research to see if I can help.

In your landscape client.conf file I noticed some fields are missing information: did you redact this for security reasons?

If not, perhaps you need to add the information in as they show here

In /etc/landscape/client.conf:

[client]
log_level = info 
url = https://landscape.canonical.com/message-system
ping_url = http://landscape.canonical.com/ping
data_path = /var/lib/landscape/client
registration_key = changeme #add as relevant
computer_title = my_machine #add as relevant
account_name = myaccount #add as relevant
include_manager_plugins = ScriptExecution
script_users = root,landscape,nobody

And then possibly do this too:
In /etc/default/landscape-client:

RUN=1

Hope this helps somehow.

Yes, it’s redacted.

I just noticed today that scripts are executing on the computer, but the “status” over the portal is not updating.

It takes hours to update the status and there’s clearly an issue here which does not seem to be related to configuration.

Would checking logs provide some clues as to why it takes so long?

Perhaps also check Launchpad bug tracking if others are having the same/similar issue.

That’s my issue, I can’t find proper documentation that details troubleshooting procedures to be performed on the client side, specifically regarding script execution.

This is a licensed product, I would expect at least some documentation for troubleshooting.

I tried looking under /var/logs/landscape/ but there isn’t much that can indicate to me what’s happening.

I’m running Landscape SaaS so I have no visibility on what happens on the server.

I assume this is bundled with an Ubuntu Pro subscription?

If yes, you can contact support and request help here

I was not able to find specific documentation for this issue.

We’ve opted for the self-support (software only) package for desktops/workstations.

@epomattiio sorry you’re having trouble with this.

I have only ever used the SAAS landscape solution. But I notice there are instructions to self-install. I’ll see if I can find some time to do that this weekend and report back my findings!

I’ve installed it myself too. The managed SaaS landscape is a better fit for us than the self-hosted option.

I noticed that scripts are executing, the problem is the status will not update. It take hours to sync to landscape.

This is not as bad, but clearly an issue.

No updates on this? Tried yet another setup with a local Ubuntu on VirtualBox, same delays.

I’ve noticed that package profile installation is also extremely slow. A small package is taking almost 20 minutes to complete.

The receival and execution is fast. It seems that the “acknowledgement” back to Landscape is delaying.

image

After much troubleshooting I understood that the packages were still syncing from the machine being registered, and this takes quite a bit of time, resulting in this behavior…

1 Like

I am too noticing a huge delay on script execution status and output being reported back to Landscape.

These are simple scripts which either just do ls or echo "Hello World" .
More complex ones is logging logs from running docker containers.

Some examples

Delivered at: 11:04
Completed at: 15:27
Screenshot 2025-02-14 at 11.37.12 AM

Similarly to @epomattiio, it seems the scripts do execute on the device, but they are not reported back to Landscape.
This defeats the purpose of remote script execution if we don’t get the feedback from a device that is not physically accessible to us.

It would be good to get clarity on why this is taking too long, and troubleshooting steps of course if we are doing anything wrong.

@zoranilievski If you just registered the machine, it can take something like 2 hours before it finishes syncing packages. It does that with 500 packages at a time. While that is happening, apt will keep being locked, and your scripts or packages installation will get postponed.

You can follow this process by looking into the client log files, and adjust these intervals in the client configuration files. I was not yet able to tune the Landscape server to do initial sync more quickly.

The solution is to sit and wait until the sync is done.

I looked around and found no documentation for this, and there is certainly no information in the portal. Had to dig in for myself.

@epomattiio
These 1-2 machines I am referencing have been registered well over 3 weeks ago and installed in their remote locations.

They ping consistently, and the last ping time updates regularly, however an arbitrary script that just echoes Hello World takes all day to report back output to landscape.

I will try to have a look what is possible with the client log and configuration files.
I appreciate the response.

Sync /var/log/landscape/*.log with a log service, that’ll help. I used New Relic but anything will do.

We have a self-hosted solution, and the above is true as well. The scripts sometimes remain In progress indefinitely without reporting back. We even created the annotation that we use as an additional check if the machine is reporting back to the server, printing out date and time.
So some Activities just pile up and we have to use API to clean up “delivered” ones regularly.
Found no useful info on how to troubleshoot this, looking at the client and server logs didn’t really help much - or I just missed something.