Install fedora-messaging and publish a test message
fedora-messaging
fedora-messaging is like a live feed of the Fedora Project. Different kinds of contribution activities are registered in the fedora-messaging bus. This allows an application to publish a message that triggers an application somewhere else in Fedora, like awarding a new Fedora Badge.
fedora-happiness-packets will publish messages to the Fedora Infrastructure fedora-messaging bus. Later, an automated badge rule needs to be created so when someone sends a Happiness Packet, they receive a badge for sending a message. Understanding how fedora-messaging works is useful to understand for future development work.
fedora-happiness-packets
Complete the following steps:
Use the fedora-messaging documentation for guidance. You can post a screenshot of running your test script here in the ticket if you want. :computer: :camera:
Note: This issue will remain open until the end of the Summer Coding 2019 community bonding period. This ticket does not require an assignee to work on this task – it can be repeated by anyone.
Hey @jflory7, I would like to claim the task.
Hi @jflory7, My name is Ana and I am an Outreachy applicant who would like to work on this task as my first contribution. Thanks :)
@jflory7 @jonatoni Thanks for looking into my PRs. I followed your suggestions. i have created a pull requests for this changes using the upstream project in github at
For the fix of duplicate button https://github.com/mxsasha/happinesspackets/pull/46
For modifying the faq template
https://github.com/mxsasha/happinesspackets/pull/45
KINDLY HAVE A LOOK AT IT
@alishapapun @anasustic Anyone can work on this task. Since multiple people can work on this at the same time, it doesn't need to be assigned. Feel free to start working on this.
@feisal Thanks, but those pull requests are off-topic for this ticket. Please link them in the correct ticket, not in this one.
@jflory7 I was able to setup fedora-messaging by following the guidelines and publish and consume messages by following this.
Snapshots for the same are attached below:
<img alt="publishing.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/f501a2eec443d87d5778232a580ac3f7f5f2776a69ee8fcd0dc12116d0bb76b7-publishing.png" /><img alt="Listening.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/d9f44dcce52a19af03fdb57f45b525c2c8ba73dbdac05d1ceb48ed202fdca251-Listening.png" />
While setting up the package, I ran into the following errors:
error: The 'pyasn1' distribution was not found and is required by service-identity Solution: Install pyasn1 manually by running the following command. pip3 install pyasn1 Now again execute python setup.py develop
error: The 'pyasn1' distribution was not found and is required by service-identity
pip3 install pyasn1
python setup.py develop
For Ubuntu/Debian based systems (Here used, Ubuntu 18.04 LTS) refer this guideline to install and successfully run RabbitMQ server.
On my machine, no directory in /etc/ named fedora-messaging was present as described here and fedora-messaging --conf PATH was giving an error Error: Missing command. so I tried an alternate approach by setting the environment variable FEDORA_MESSAGING_CONF to the path where config.toml resides.
fedora-messaging --conf PATH
Error: Missing command.
FEDORA_MESSAGING_CONF
Hope this helps anyone trying to do the setup for the same! Cheers :)
@shraddhaag Awesome work! :100: Thanks for sharing your feedback here. This is a good precursor to #96.
Hmm. I don't see the pyasn1 package in either the requirements.txt or dev-requirements.txt of upstream fedora-messaging. I wonder if it is an untracked dependency.
pyasn1
@jcline @abompard Any ideas if this is an easyfix for the PyPI package?
pyasn1 and pyasn1-modules are both dependencies of service_identity so this probably has to do with the old setuptools bug about using dashes in package names breaking everything.
@shraddhaag what version of pip and setuptools are you using? I'm unable to reproduce the issue with:
$ pip --version pip 19.0.3 from /home/jcline/.virtualenvs/test-fm-install/lib/python3.7/site-packages/pip (python 3.7) $ easy_install --version setuptools 40.8.0 from /home/jcline/.virtualenvs/test-fm-install/lib/python3.7/site-packages (Python 3.7)
@shraddhaag what version of pip and setuptools are you using? I'm unable to reproduce the issue with: $ pip --version pip 19.0.3 from /home/jcline/.virtualenvs/test-fm-install/lib/python3.7/site-packages/pip (python 3.7) $ easy_install --version setuptools 40.8.0 from /home/jcline/.virtualenvs/test-fm-install/lib/python3.7/site-packages (Python 3.7)
I ran the setup with the following versions:
$ pip --version pip 19.0.3 from /home/shraddha/.virtualenvs/fedora-messaging-tutorial/lib/python3.6/site-packages/pip (python 3.6)
$ easy_install --version setuptools 40.8.0 from /home/shraddha/.virtualenvs/fedora-messaging-tutorial/lib/python3.6/site-packages/pip (python 3.6)
$ python3 --version Python 3.6.7
I suppose it's the python version causing the problem.
Hi @jcline! I was able to resolve this by executing pip install -r requirements.txt -r dev-requirements.txt. After executing this when I run python setup.py develop no errors are encountered.
pip install -r requirements.txt -r dev-requirements.txt
Putting it here, for anyone else trying to do the same and encountering the same issue. :)
Hi! I was able to set up fedora-messaging successfully. <img alt="message.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/18494525595044a10499ad894c508e1f76e0921cb9af19d72e37e989ba7312fc-message.png" />
However, I ran into this same issues:
error: The 'pyasn1' distribution was not found and is required by service-identity Solution: Install pyasn1 manually by running the following command. pip3 install pyasn1 Now again execute python setup.py develop On my machine, no directory in /etc/ named fedora-messaging was present as described here and fedora-messaging --conf PATH was giving an error Error: Missing command. so I tried an alternate approach by setting the environment variable FEDORA_MESSAGING_CONF to the path where config.toml resides.
Thanks @shraddhaag for the heads up!
@jflory7 I was able to setup fedora-messaging by following the guidelines and publish and consume messages by following this. Snapshots for the same are attached below: While setting up the package, I ran into the following errors: error: The 'pyasn1' distribution was not found and is required by service-identity Solution: Install pyasn1 manually by running the following command. pip3 install pyasn1 Now again execute python setup.py develop For Ubuntu/Debian based systems (Here used, Ubuntu 18.04 LTS) refer this guideline to install and successfully run RabbitMQ server. On my machine, no directory in /etc/ named fedora-messaging was present as described here and fedora-messaging --conf PATH was giving an error Error: Missing command. so I tried an alternate approach by setting the environment variable FEDORA_MESSAGING_CONF to the path where config.toml resides. Hope this helps anyone trying to do the setup for the same! Cheers :)
@jflory7 I was able to setup fedora-messaging by following the guidelines and publish and consume messages by following this. Snapshots for the same are attached below: While setting up the package, I ran into the following errors:
@shraddhaag Hey Shradha can you elaborate how you set FEDORA_MESSAGING_CONF to the path where config.toml resides. I am unable to get a clear picture.
@alishapapun You simple need to set up the environment variable. Run export FEDORA_MESSAGING_CONF= and insert the path to file config.toml.
export FEDORA_MESSAGING_CONF=
config.toml
@shraddhaag Hey Shradha can you elaborate how you set FEDORA_MESSAGING_CONF to the path where config.toml resides. I am unable to get a clear picture. @alishapapun You simple need to set up the environment variable. Run export FEDORA_MESSAGING_CONF= and insert the path to file config.toml.
@shraddhaag I don't have a fedora-messaging in etc folder, as you have said. So, which config.toml path I have to set? Do you mean config.toml.example ? I tried that too, but it still has the same error.
@alishapapun As mentioned in the installation guide clearly, you need to copy the config.toml.example and create a new file config.toml. And then provide the path to this file in the environment variable.
config.toml.example
The setup for fedora-messaging is successful. :) <img alt="Screenshot_from_2019-03-02_20-34-35.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/a88c336b34268dbd4fc9a1210bd26e7b85e1c0cefb1f1020e5142926c53a16cb-Screenshot_from_2019-03-02_20-34-35.png" />
Excellent! Nice work @mauaraujo and @alishapapun. :tada: Thanks @shraddhaag for jumping in to help.
Hi,
I was able to install fedora-messaging locally and publish a test message :grinning:
I was somewhat mislead with the installation link . It would be probably better to use this installation link . I also had to install virtualenv along with virtualenvwrapper. @shraddhaag comments helped me regarding 'pyasn1' and to set up fedora-messaging environment variable as well as how to setup RabbitMQ server. For me guest/guest doesn't work on the RabbitMQ console.
<img alt="message.JPG" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/ab7c1c4ee92eb78ec76607b6c91c33aedd702b96a8a4fc5e0459cf8826038583-message.JPG" />
I was able to install fedora-messaging locally and publish a test message :smiley:
Super @anasustic! :tada: :tada: Nice work.
I was somewhat mislead with the installation link . It would be probably better to use this installation link .
I agree. Good catch. :thumbsup: I edited the ticket comment.
For me guest/guest doesn't work on the RabbitMQ console.
How did you install RabbitMQ? The documentation uses dnf with Fedora but there other ways to install it. One possibility is a different RabbitMQ package ships changed defaults in their package. It might help to search for what the default login credentials are for your install method. This is my first guess.
dnf
Hi @anasustic! You can refer this to create a new user for managing RabbitMQ. Let me know if this doesn't work out for you. Before trying this make sure you followed all the steps to installing RabbitMQ, especially Managing RabbitMQ (it's given right at the end of the page)
Hi @shraddhaag, Fantastic :tada: Creating a new user for managing RabbitMQ worked as a charm. I can now logon to the web interface.
Add a new/fresh user, say user test and password test: rabbitmqctl add_user test test Give administrative access to the new user: rabbitmqctl set_user_tags test administrator Set permission to newly created user: rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
Reading the link further it appear this is a new features of RabbitMQ since the version 3.3.0. You can only login using guest/guest on localhost. For logging from other machines or using IP you'll have to create users and assign the permissions.
Thanks for your help :raised_hand:
Did anybody face this issue? Am getting the following error.
[pika.adapters.utils.io_services_utils ERROR] Socket failed to connect: <socket.socket fd=9, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 62430, 0, 0)>; error=61 (Connection refused) [pika.adapters.utils.connection_workflow ERROR] TCP Connection attempt failed: ConnectionRefusedError(61, 'Connection refused'); dest=(<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 5672, 0, 0)) [pika.adapters.utils.connection_workflow ERROR] AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(61, 'Connection refused')
However, it gets connected to the localhost succesfully and am able to receive the message.
<img alt="Screen_Shot_2019-03-08_at_5.53.29_pm.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/92d4c4040d6efbd477f9629d40aac7a9c72bcf9a2b176b4655f798e046f2a1ac-Screen_Shot_2019-03-08_at_5.53.29_pm.png" />
Hi @bhuvana : Did you publish the message?
Hi @anasustic . I did publish the message. Screenshot attached. <img alt="Screen_Shot_2019-03-08_at_6.59.41_pm.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/62d48247373489e5746b2511961a59bfd55d807c5898f46cf5efa804d094814f-Screen_Shot_2019-03-08_at_6.59.41_pm.png" />
Hi all! Thanks everyone who participated with Fedora during the Outreachy application cycle. Since the application period closed today, I am closing this ticket as complete. :clapper:
An extra thanks goes to everyone who helped mentor and guide others who faced problems in this ticket. :blush:
Metadata Update from @jflory7: - Issue close_status updated to: complete - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.