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

Encountering PublishTimeout exceptions when adding a site and setting host information in MirrorManager2 on Fedora Workstation 38 #332

Open Edward-Elric233 opened 8 months ago

Edward-Elric233 commented 8 months ago

I am a beginner and trying to manage yum repositories using MirrorManager2 on Fedora Workstation 38.

$ cat /etc/os-release 
NAME="Fedora Linux"
VERSION="38 (Workstation Edition)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux 38 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:38"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=38
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=38
SUPPORT_END=2024-05-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation

I have successfully set up and run MirrorManager2 in Vagrant following the instructions in the README.

[edward@fedora mirrormanager2]$ vagrant global-status 
id       name           provider state   directory                                  
------------------------------------------------------------------------------------
b634250  ipa            libvirt running /home/edward/MirrorManager2/tiny-stage     
5f98c6f  auth           libvirt running /home/edward/MirrorManager2/tiny-stage     
19bd367  mirrormanager2 libvirt running /home/edward/MirrorManager2/mirrormanager2 

The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"

After logining to https://mirrormanager2.tinystage.test/, I am attempting to add a site and set the host information.

image-20231020153958756 image-20231020154208619 image-20231020153453543

PublishTimeout

fedora_messaging.exceptions.PublishTimeout: Publishing timed out after waiting 30 seconds.
Traceback (most recent call last)

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/fedora_messaging/api.py", line 316, in publish

    eventual_result.wait(timeout=timeout)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/crochet/_eventloop.py", line 194, in wait

    result = self._result(timeout)
             ^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/crochet/_eventloop.py", line 173, in _result

    raise TimeoutError()
    ^^^^^^^^^^^^^^^^^^^^

    During handling of the above exception, another exception occurred:
    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/flask/app.py", line 2213, in __call__

    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/flask/app.py", line 2193, in wsgi_app

    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app

    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request

    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request

    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request

    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/vagrant/mirrormanager2/perms.py", line 50, in decorated_function

    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/vagrant/mirrormanager2/views.py", line 273, in host_new

    fedmsg_publish(topic, message)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/vagrant/mirrormanager2/lib/notifications.py", line 49, in fedmsg_publish

    safe_publish(msg)
    ^^^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/backoff/_sync.py", line 105, in retry

    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^

    File "/vagrant/mirrormanager2/lib/notifications.py", line 43, in safe_publish

    fm_publish(msg)
    ^^^^^^^^^^^^^^^

    File "/root/.cache/pypoetry/virtualenvs/mirrormanager2-vs8V2ZPt-py3.11/lib/python3.11/site-packages/fedora_messaging/api.py", line 324, in publish

    raise wrapper
    ^^^^^^^^^^^^^

    fedora_messaging.exceptions.PublishTimeout: Publishing timed out after waiting 30 seconds.

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

    dump() shows all variables in the frame
    dump(obj) dumps all that's known about the object

However, I encounter an error as shown in the attached screenshot. I am not sure why this issue is occurring and would appreciate any guidance on how to resolve it. Thank you in advance for any help you can provide.

abompard commented 8 months ago

Hi! MirrorManager is trying to publish a Fedora Messaging message, but the rabbitmq server isn't running. Try running the tinystage VM in TinyStage, it contains the rabbitmq server. This should fix the issue, if so we'll update the docs.

Edward-Elric233 commented 8 months ago

Thank you for your response. Unfortunately, after starting the tinystage virtual machine, I encountered the same problem when trying to add a host to the site again.

$ vagrant global-status 
id       name           provider state   directory                                  
------------------------------------------------------------------------------------
dc6b384  ipa            libvirt running /home/edward/MirrorManager2/tiny-stage     
48959de  auth           libvirt running /home/edward/MirrorManager2/tiny-stage     
65bda03  tinystage      libvirt running /home/edward/MirrorManager2/tiny-stage     
9ab0cf3  mirrormanager2 libvirt running /home/edward/MirrorManager2/mirrormanager2 

The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"

image image

how should I solve this problem?

KimFarida commented 3 months ago

@abompard @gridhead Hello, can i take up this issue? And would it count as an outreachy contribution?