Closed Bug 1203146 Opened 9 years ago Closed 9 years ago

Pulse Actions throws an unreadable exception when the proper env variables are not set up

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: armenzg, Assigned: nikkibee, Mentored)

Details

(Whiteboard: [good first bug])

Attachments

(1 file)

47 bytes, text/x-github-pull-request
adusca
: review+
Details | Review
adusca: what am I doing wrong?

These are the steps I followed:
* Checkout https://github.com/adusca/pulse_actions.git
* Setup a virtualenv
* Install the project inside of it with python setup.py develop
* Run python pulse_actions/worker.py --topic-base backfilling --dry-run

Traceback (most recent call last):
  File "pulse_actions/worker.py", line 61, in run_pulse
    pulse.listen()
  File "build/bdist.macosx-10.6-intel/egg/mozillapulse/consumers.py", line 148, in listen
    on_connect_callback=on_connect_callback
  File "build/bdist.macosx-10.6-intel/egg/mozillapulse/consumers.py", line 166, in _build_consumer
    exchange(self.connection).declare(passive=True)
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/abstract.py", line 66, in __call__
    return self.bind(channel)
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/abstract.py", line 70, in bind
    return copy(self).maybe_bind(channel)
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/abstract.py", line 75, in maybe_bind
    self._channel = maybe_channel(channel)
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/connection.py", line 1054, in maybe_channel
    return channel.default_channel
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/connection.py", line 756, in default_channel
    self.connection
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/connection.py", line 741, in connection
    self._connection = self._establish_connection()
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/connection.py", line 696, in _establish_connection
    conn = self.transport.establish_connection()
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/kombu-3.0.26-py2.7.egg/kombu/transport/pyamqp.py", line 116, in establish_connection
    conn = self.Connection(**opts)
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/amqp-1.4.6-py2.7.egg/amqp/connection.py", line 180, in __init__
    (10, 30),  # tune
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/amqp-1.4.6-py2.7.egg/amqp/abstract_channel.py", line 67, in wait
    self.channel_id, allowed_methods)
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/amqp-1.4.6-py2.7.egg/amqp/connection.py", line 240, in _wait_method
    self.method_reader.read_method()
  File "/Users/armenzg/venv/pulse_actions/lib/python2.7/site-packages/amqp-1.4.6-py2.7.egg/amqp/method_framing.py", line 189, in read_method
    raise m
IOError: Socket closed
Mentor: armenzg
Summary: Running automatic backfilling locally fails → Pulse Actions throws an unreadable exception when the proper env variables are not set up
Whiteboard: [good first bug]
Pulse Actions throws the above error when the env variables "PULSE_USER" and "PULSE_PW" are not set.

That is because on [1] we only do os.environ.get('PULSE_USER'), it just returns None and then when we try to create a pulse user with user = None, password = None we get an authentication error.

Instead we should verify if the env variables are set up and throw a more meaningful error when they are not, or maybe even ask the user to supply their credentials. 

[1] https://github.com/adusca/pulse_actions/blob/master/pulse_actions/worker.py#L39
I'd like to work on this.
Nikki, feel free to ask questions here or on IRC. You can checkout the Readme here: https://github.com/adusca/pulse_actions
Assignee: nobody → nikkicubed
Hi nikkibee,
Thanks for your help!

Could you please try the steps from the description so you reproduce the same issue?

Please put any questions you have with regards to understanding what adusca or I mention. All questions are good.
Thanks to both of you! I've taken a good look at the readme and reproduced the issue as outlined. I'll take my questions to irc since I will find that faster to do.
I've made my pull request here: https://github.com/adusca/pulse_actions/pull/18
Attached file PR from nikibee
Hi @nikkibee,
Thanks for the PR.

Here's a bugzilla trick of the day, you can "attach" a PR to a bugzilla ticket and request a review from a bugzilla user.

I gave this one to :adusca since she's more experience in this code.
adusca: let me know if you would like me to look at it.

If you click on "attach file", you will get to a new page.
On that page (which I'm using to write this comment and attach the PR), you can click on "paste text as attachment".
In that box, you can paste the URL to the PR.
You add a short description and you change the "review" dropbox to be a question mark "?". On the filed after the question mark you can enter a user's nick name preceded by ":" (e.g. :adusca, :armenzg).

By doing this, Bugzilla will show on the reviewer's bugzilla a big red circle on the top left with a number inside it making reference to how many review requests or need info request they have.

It makes it less easy for a reviewer to miss a review request.
Attachment #8662359 - Flags: review?(alicescarpa)
Attachment #8662359 - Flags: review?(alicescarpa) → review+
Fixed in https://github.com/adusca/pulse_actions/commit/eb548dff68f784baa6f71f38b8c3ce1069d1dfe9
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: