Dependency issue on Manjaro #735

Closed
opened 2023-07-31 19:31:33 +00:00 by aardbol · 12 comments

What I'm trying to do and why

Create a backup or even a simple version check fails.

Steps to reproduce

sudo borgmatic create --verbosity 1 --list --stats

Actual behavior

Traceback (most recent call last):
  File "/usr/bin/borgmatic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 866, in main
    or list(collect_configuration_run_summary_logs(configs, arguments))
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 747, in collect_configuration_run_summary_logs
    results = list(run_configuration(config_filename, config, arguments))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 125, in run_configuration
    yield from run_actions(
  File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 308, in run_actions
    yield from borgmatic.actions.create.run_create(
  File "/usr/lib/python3.11/site-packages/borgmatic/actions/create.py", line 94, in run_create
    create_borgmatic_manifest(config, global_arguments.used_config_paths, global_arguments.dry_run)
  File "/usr/lib/python3.11/site-packages/borgmatic/actions/create.py", line 42, in create_borgmatic_manifest
    'borgmatic_version': importlib_metadata.version('borgmatic'),
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'importlib_metadata' has no attribute 'version'

Expected behavior

No response

Other notes / implementation ideas

No response

borgmatic version

1.8.0

borgmatic installation method

pacman

Borg version

borg 1.2.4

Python version

Python 3.11.3

Database version (if applicable)

No response

Operating system and version

manjaro

### What I'm trying to do and why Create a backup or even a simple version check fails. ### Steps to reproduce sudo borgmatic create --verbosity 1 --list --stats ### Actual behavior ``` Traceback (most recent call last): File "/usr/bin/borgmatic", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 866, in main or list(collect_configuration_run_summary_logs(configs, arguments)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 747, in collect_configuration_run_summary_logs results = list(run_configuration(config_filename, config, arguments)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 125, in run_configuration yield from run_actions( File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 308, in run_actions yield from borgmatic.actions.create.run_create( File "/usr/lib/python3.11/site-packages/borgmatic/actions/create.py", line 94, in run_create create_borgmatic_manifest(config, global_arguments.used_config_paths, global_arguments.dry_run) File "/usr/lib/python3.11/site-packages/borgmatic/actions/create.py", line 42, in create_borgmatic_manifest 'borgmatic_version': importlib_metadata.version('borgmatic'), ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'importlib_metadata' has no attribute 'version' ``` ### Expected behavior _No response_ ### Other notes / implementation ideas _No response_ ### borgmatic version 1.8.0 ### borgmatic installation method pacman ### Borg version borg 1.2.4 ### Python version Python 3.11.3 ### Database version (if applicable) _No response_ ### Operating system and version manjaro
Owner

Thanks for filing this! A couple of questions so I can hopefully repro it:

On Manjaro stable here, I can't even install 1.8.0 of that package because it's built for a newer version of Python than I have. So if I sudo pacman -S borgmatic I only get 1.7.12 which doesn't have the problem you're experiencing.

Thanks for filing this! A couple of questions so I can hopefully repro it: * What version of Manjaro are you using? Stable or unstable? * What command are you using to install borgmatic with pacman? * Do you know if you're installing this package or one from another source? https://archlinux.org/packages/extra/any/borgmatic/ On Manjaro stable here, I can't even install 1.8.0 of that package because it's built for a newer version of Python than I have. So if I `sudo pacman -S borgmatic` I only get 1.7.12 which doesn't have the problem you're experiencing.
witten added the
waiting for response
label 2023-08-05 03:44:01 +00:00
Author

Hi Witten

Thanks for your quick reply. For some reason I didn't get en email about it.

To answer to your questions:

  • I'm using latest testing
  • pikaur -S borgmatic
  • that one indeed

I can install 1.8.0 without an issue, and now even your recent minor update is available already.

Hi Witten Thanks for your quick reply. ~~For some reason I didn't get en email about it.~~ To answer to your questions: - I'm using latest testing - pikaur -S borgmatic - that one indeed I can install 1.8.0 without an issue, and now even your recent minor update is available already.
witten removed the
waiting for response
label 2023-08-05 23:27:39 +00:00
Owner

Thanks for the details. I'll spin up a VM with Manjaro testing when I get a chance and try to repro this.

Thanks for the details. I'll spin up a VM with Manjaro testing when I get a chance and try to repro this.
Owner

I unfortunately wasn't able to repro this. I tried with both Manjaro testing in a VM and in a container. Here's some additional information from your system that may help me debug this: I'd like to see the output of the following commands. Some of them may error, but that should be okay; these are all read-only operations:

  • python -c 'import importlib_metadata as m; print(m.__file__)'
  • python -c 'import importlib_metadata as m; print(m.__file__)' | pacman -Qo -
  • python -c 'import importlib_metadata as m; print(dir(m))'
  • python -c 'import importlib.metadata as m; print(m.__file__)'
  • python -c 'import importlib.metadata as m; print(m.__file__)' | pacman -Qo -
  • python -c 'import importlib.metadata as m; print(dir(m))'

Thank you!

I unfortunately wasn't able to repro this. I tried with both Manjaro testing in a VM and in a container. Here's some additional information from your system that may help me debug this: I'd like to see the output of the following commands. Some of them may error, but that should be okay; these are all read-only operations: * `python -c 'import importlib_metadata as m; print(m.__file__)'` * `python -c 'import importlib_metadata as m; print(m.__file__)' | pacman -Qo -` * `python -c 'import importlib_metadata as m; print(dir(m))'` * `python -c 'import importlib.metadata as m; print(m.__file__)'` * `python -c 'import importlib.metadata as m; print(m.__file__)' | pacman -Qo -` * `python -c 'import importlib.metadata as m; print(dir(m))'` Thank you!
Author
  • /home/ik/.local/lib/python3.11/site-packages/importlib_metadata/__init__.py
  • error: No package owns /home/ik/.local/lib/python3.11/site-packages/importlib_metadata/__init__.py
  • ['DeprecatedNonAbstract', 'DeprecatedTuple', 'Distribution', 'DistributionFinder', 'EntryPoint', 'EntryPoints', 'FastPath', 'FileHash', 'FreezableDefaultDict', 'Iterable', 'List', 'Lookup', 'Mapping', 'MetaPathFinder', 'MetadataPathFinder', 'NullFinder', 'Optional', 'PackageMetadata', 'PackageNotFoundError', 'PackagePath', 'Pair', 'PathDistribution', 'Prepared', 'Sectioned', 'Set', 'SimplePath', 'StrPath', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_adapters', '_collections', '_compat', '_functools', '_itertools', '_meta', '_py39compat', '_text', '_top_level_declared', '_top_level_inferred', '_unique', 'abc', 'always_iterable', 'cast', 'collections', 'contextlib', 'csv', 'distribution', 'distributions', 'email', 'entry_points', 'files', 'functools', 'import_module', 'inspect', 'install', 'itertools', 'metadata', 'method_cache', 'operator', 'os', 'packages_distributions', 'pass_none', 'pathlib', 'posixpath', 'pypy_partial', 're', 'requires', 'starmap', 'suppress', 'sys', 'textwrap', 'unique_everseen', 'version', 'warnings', 'zipp']
  • /usr/lib/python3.11/importlib/metadata/__init__.py
  • /usr/lib/python3.11/importlib/metadata/__init__.py is owned by python 3.11.3-2
  • ['Deprecated', 'DeprecatedList', 'DeprecatedTuple', 'Distribution', 'DistributionFinder', 'EntryPoint', 'EntryPoints', 'FastPath', 'FileHash', 'FreezableDefaultDict', 'List', 'Lookup', 'Mapping', 'MetaPathFinder', 'MetadataPathFinder', 'Optional', 'PackageMetadata', 'PackageNotFoundError', 'PackagePath', 'Pair', 'PathDistribution', 'Prepared', 'Sectioned', 'SelectableGroups', 'SimplePath', 'Union', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_adapters', '_collections', '_functools', '_itertools', '_meta', '_text', '_top_level_declared', '_top_level_inferred', '_unique', 'abc', 'always_iterable', 'collections', 'csv', 'distribution', 'distributions', 'email', 'entry_points', 'files', 'functools', 'import_module', 'itertools', 'metadata', 'method_cache', 'operator', 'os', 'packages_distributions', 'pass_none', 'pathlib', 'posixpath', 're', 'requires', 'starmap', 'suppress', 'sys', 'textwrap', 'unique_everseen', 'version', 'warnings', 'zipfile']

Thank you too!

- `/home/ik/.local/lib/python3.11/site-packages/importlib_metadata/__init__.py` - `error: No package owns /home/ik/.local/lib/python3.11/site-packages/importlib_metadata/__init__.py` - `['DeprecatedNonAbstract', 'DeprecatedTuple', 'Distribution', 'DistributionFinder', 'EntryPoint', 'EntryPoints', 'FastPath', 'FileHash', 'FreezableDefaultDict', 'Iterable', 'List', 'Lookup', 'Mapping', 'MetaPathFinder', 'MetadataPathFinder', 'NullFinder', 'Optional', 'PackageMetadata', 'PackageNotFoundError', 'PackagePath', 'Pair', 'PathDistribution', 'Prepared', 'Sectioned', 'Set', 'SimplePath', 'StrPath', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_adapters', '_collections', '_compat', '_functools', '_itertools', '_meta', '_py39compat', '_text', '_top_level_declared', '_top_level_inferred', '_unique', 'abc', 'always_iterable', 'cast', 'collections', 'contextlib', 'csv', 'distribution', 'distributions', 'email', 'entry_points', 'files', 'functools', 'import_module', 'inspect', 'install', 'itertools', 'metadata', 'method_cache', 'operator', 'os', 'packages_distributions', 'pass_none', 'pathlib', 'posixpath', 'pypy_partial', 're', 'requires', 'starmap', 'suppress', 'sys', 'textwrap', 'unique_everseen', 'version', 'warnings', 'zipp']` - `/usr/lib/python3.11/importlib/metadata/__init__.py` - `/usr/lib/python3.11/importlib/metadata/__init__.py is owned by python 3.11.3-2` - `['Deprecated', 'DeprecatedList', 'DeprecatedTuple', 'Distribution', 'DistributionFinder', 'EntryPoint', 'EntryPoints', 'FastPath', 'FileHash', 'FreezableDefaultDict', 'List', 'Lookup', 'Mapping', 'MetaPathFinder', 'MetadataPathFinder', 'Optional', 'PackageMetadata', 'PackageNotFoundError', 'PackagePath', 'Pair', 'PathDistribution', 'Prepared', 'Sectioned', 'SelectableGroups', 'SimplePath', 'Union', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_adapters', '_collections', '_functools', '_itertools', '_meta', '_text', '_top_level_declared', '_top_level_inferred', '_unique', 'abc', 'always_iterable', 'collections', 'csv', 'distribution', 'distributions', 'email', 'entry_points', 'files', 'functools', 'import_module', 'itertools', 'metadata', 'method_cache', 'operator', 'os', 'packages_distributions', 'pass_none', 'pathlib', 'posixpath', 're', 'requires', 'starmap', 'suppress', 'sys', 'textwrap', 'unique_everseen', 'version', 'warnings', 'zipfile']` Thank you too!
Owner

Huh, that makes no sense whatsoever! Because, based on that output, the attribute that the borgmatic error is complaining out (importlib_metadata.version) clearly exists. The only thing I can think of is you've somehow manually installed importlib_metadata with pip and not from a Manjaro package (judging by that No package owns ... output), and that's somehow causing problems. (For more background than anyone probably ever wanted on that topic, see here.)

So one thing you could do is try uninstalling the pip-installed importlib_metadata. If you're willing to try that, that would look something like:

sudo pip3 uninstall importlib_metadata

And then if you do still want the non-builtin importlib_metadata package for whatever reason, you could optionally install it with your official Manjaro package manager of choice:

sudo pacman -S python-importlib-metadata

But that last step would be optional as far as borgmatic is concerned. It should be able to use the built-in Python 3.11.3 importlib.metadata just fine.

Huh, that makes no sense whatsoever! Because, based on that output, the attribute that the borgmatic error is complaining out (`importlib_metadata.version`) clearly exists. The only thing I can think of is you've somehow manually installed `importlib_metadata` with pip and not from a Manjaro package (judging by that `No package owns ...` output), and that's somehow causing problems. (For more background than anyone probably ever wanted on that topic, [see here](https://peps.python.org/pep-0668/).) So one thing you *could* do is try uninstalling the pip-installed `importlib_metadata`. If you're willing to try that, that would look something like: ```shell sudo pip3 uninstall importlib_metadata ``` And then if you *do* still want the non-builtin `importlib_metadata` package for whatever reason, you could optionally install it with your official Manjaro package manager of choice: ```shell sudo pacman -S python-importlib-metadata ``` But that last step would be optional as far as borgmatic is concerned. It should be able to use the built-in Python 3.11.3 `importlib.metadata` just fine.
Author

That was indeed the issue. I've cleaned up the pip installations that I installed/upgraded manually and borgmatic works smoothly now.

Manjaro only recently included this "externally managed" option but I'm glad they did, so there's much less chance to mess it up next time.

Thanks a lot again for your help. On to the next 5 years of using borgmatic!

That was indeed the issue. I've cleaned up the pip installations that I installed/upgraded manually and borgmatic works smoothly now. Manjaro only recently included this "externally managed" option but I'm glad they did, so there's much less chance to mess it up next time. Thanks a lot again for your help. On to the next 5 years of using borgmatic!
Owner

Phew, I'm glad to hear that was it! Thanks for all the help tracking this down.

Phew, I'm glad to hear that was it! Thanks for all the help tracking this down.
Author

Don't you have any means of donation? I looked around but couldn't find anything. Since I'm also using bm for my business laptop and for years for personal use and was always helped so awesomely with any issue, I gladly wanna buy you a coffee.

Don't you have any means of donation? I looked around but couldn't find anything. Since I'm also using bm for my business laptop and for years for personal use and was always helped so awesomely with any issue, I gladly wanna buy you a coffee.
Owner

That's very kind of you, and I'm glad to hear borgmatic has been working out! But I haven't set up anything like donations so far. I do have a couple referral links though. Maybe the next time you're evaluating your Borg hosting providers, have a look. You might also consider donating directly to the Borg project, which borgmatic obviously leans heavily on.

That's very kind of you, and I'm glad to hear borgmatic has been working out! But I haven't set up anything like donations so far. I do have a couple referral links though. Maybe the next time you're evaluating your Borg hosting providers, [have a look](https://torsion.org/borgmatic/#hosting-providers). You might also consider [donating directly to the Borg project](https://www.borgbackup.org/support/fund.html), which borgmatic obviously leans heavily on.
Author

Sure, I know about those alternatives. But I don't need any Borg hosting provider and Borg will be taking into account as well for a donation. Should you have any other means, like Wise or PayPal, I'd be happy to hear it anytime.

Sure, I know about those alternatives. But I don't need any Borg hosting provider and Borg will be taking into account as well for a donation. Should you have any other means, like Wise or PayPal, I'd be happy to hear it anytime.
Owner

Thanks, I'll let you know if/when I put up a link!

Thanks, I'll let you know if/when I put up a link!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#735
No description provided.