make sampledata can't find machine-resources

Bug #1915359 reported by Huw Wilkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Low
Adam Collard

Bug Description

When running `make sampledata` using maas master it fails with:

```
$ make sampledata
ln -sf ../.ve/bin/maas-region bin/maas-region
ln -sf ../.ve/bin/postgresfixture bin/postgresfixture
bin/database --preserve run -- bin/maas-region dbupgrade
Operations to perform:
  Apply all migrations: auth, contenttypes, maasserver, metadataserver, piston3, sessions, sites
Running migrations:
  No migrations to apply.
bin/database --preserve run -- bin/maas-region generate_sample_data
Traceback (most recent call last):
  File "bin/maas-region", line 11, in <module>
    load_entry_point('maas', 'console_scripts', 'maas-region')()
  File "/home/ubuntu/maas/src/maasserver/region_script.py", line 77, in run
    run_django(is_snap, is_devenv)
  File "/home/ubuntu/maas/src/maasserver/region_script.py", line 66, in run_django
    management.execute_from_command_line()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/ubuntu/maas/src/maasserver/management/commands/generate_sample_data.py", line 25, in handle
    sampledata.populate()
  File "/home/ubuntu/maas/src/maasserver/testing/sampledata.py", line 179, in populate
    populate_main()
  File "/home/ubuntu/maas/src/maasserver/utils/orm.py", line 737, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File "/home/ubuntu/maas/src/maasserver/utils/orm.py", line 540, in retrier
    return func(*args, **kwargs)
  File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/home/ubuntu/maas/src/maasserver/testing/sampledata.py", line 326, in populate_main
    mac_addresses = get_mac_addresses()
  File "/home/ubuntu/maas/src/provisioningserver/utils/ipaddr.py", line 56, in get_mac_addresses
    ip_addr = get_ip_addr()
  File "/home/ubuntu/maas/src/provisioningserver/utils/ipaddr.py", line 43, in get_ip_addr
    output = call_and_check([get_resources_bin_path()])
  File "/home/ubuntu/maas/src/provisioningserver/utils/shell.py", line 102, in call_and_check
    process = Popen(command, *args, stdout=PIPE, stderr=PIPE, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/maas/machine-resources/amd64'
make: *** [Makefile:273: sampledata] Error 1
```

It looks like I have a `/home/ubuntu/maas/src/machine-resources/src/machine-resources/` dir, but nothing for `amd64`.

Related branches

Revision history for this message
Huw Wilkins (huwshimi) wrote :

I seem to have got things mostly working by doing:

cd src/machine-resources/
sudo make install

Then doing `make sampledata` finishes successfully.

However, doing `make all` now fails with:

```
...
rm: cannot remove 'src/machine-resources/vendor/github.com/jaypipes/pcidb/parse_test.go': Permission denied
rm: cannot remove 'src/machine-resources/vendor/github.com/jaypipes/pcidb/.gitignore': Permission denied
rm: cannot remove 'src/machine-resources/vendor/github.com/jaypipes/pcidb/context.go': Permission denied
rm: cannot remove 'src/machine-resources/vendor/github.com/jaypipes/pcidb/discover.go': Permission denied
rm: cannot remove 'src/machine-resources/vendor/github.com/jaypipes/pcidb/Gopkg.toml': Permission denied
make[1]: *** [Makefile:34: vendor] Error 1
make[1]: Leaving directory '/home/ubuntu/maas/src/machine-resources'
make: *** [Makefile:155: machine-resources-vendor] Error 2
```

Huw Wilkins (huwshimi)
tags: added: ui
tags: removed: ui
Changed in maas:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Adam Collard (adam-collard)
Changed in maas:
milestone: none → 2.10-beta1
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.