#103 Install fedora-messaging locally and publish a test message
Closed: complete 5 years ago by jflory7. Opened 5 years ago by jflory7.

Summary

Install fedora-messaging and publish a test message

Background

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.

Details

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:

Outcome

  • Working fedora-messaging installation
  • Successful understanding how to publish a message to fedora-messaging bus

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

  1. For the fix of duplicate button
    https://github.com/mxsasha/happinesspackets/pull/46

  2. 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:

publishing.pngListening.png

While setting up the package, I ran into the following errors:

  1. 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

  2. For Ubuntu/Debian based systems (Here used, Ubuntu 18.04 LTS) refer this guideline to install and successfully run RabbitMQ server.

  3. 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 :)

@shraddhaag Awesome work! :100: Thanks for sharing your feedback here. This is a good precursor to #96.

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

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.

@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.

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.
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:
publishing.pngListening.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

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 :)

@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.

@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 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.

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.

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.

For me guest/guest doesn't work on the RabbitMQ console.

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.

Screen_Shot_2019-03-08_at_5.53.29_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)

5 years ago

Log in to comment on this ticket.

Metadata
Attachments 6