fedora-infra / mirrormanager2

Rewrite of the MirrorManager application in Flask and SQLAlchemy
https://mirrormanager.fedoraproject.org
GNU General Public License v2.0
63 stars 46 forks source link

Cannot start runserver in newly created vm #326

Closed keestux closed 9 months ago

keestux commented 9 months ago

After running vagrant up and then ssh into the VM I get an error when starting runserver

kees@racer:~/src/mirrormanager2$ vagrant ssh
Last login: Wed Oct  4 18:09:28 2023 from 192.168.121.1
[vagrant@mirrormanager2 ~]$ cd /vagrant/
[vagrant@mirrormanager2 vagrant]$ python runserver.py --host 0.0.0.0
Traceback (most recent call last):
  File "/usr/lib64/python3.11/importlib/metadata/__init__.py", line 563, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/vagrant/runserver.py", line 6, in <module>
    from mirrormanager2.app import create_app
  File "/vagrant/mirrormanager2/__init__.py", line 26, in <module>
    __version__ = metadata.version("mirrormanager2")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/metadata/__init__.py", line 1008, in version
    return distribution(distribution_name).version
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/metadata/__init__.py", line 981, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/metadata/__init__.py", line 565, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for mirrormanager2
keestux commented 9 months ago

@abompard Is there maybe a mismatch between metadata and pyproject.toml and/or poetry. Or is the README not correct?

abompard commented 9 months ago

Please run sudo systemctl restart mirrormanager2, I'll update the README.

keestux commented 8 months ago

@abompard sorry, that didn't help

BTW. I would kindly request that you do not close an issue until you get confirmation that it is solved.

keestux commented 8 months ago

Sorry, I spoke too soon. It did help. I thought I needed to run runserver again.

abompard commented 8 months ago

Yeah, I understand the request, but I don't actually close the issue myself, I just reference it in the commit message. I'll try to remember to use a different prefix so that Github links the commit to the issue but does not close it.

keestux commented 8 months ago

Interesting. The commit message is the right way to do this.

I don't know how if the automatic closing has to do with pushing commits directly on the master branch. I'm more familiar with GitLab and doing Merge Requests (aka Pull Requests). With GitLab a referred issue is only closed after the merge is actually done.