OOPS loading will fail if URL is longer than allowed 500 characters

Bug #915335 reported by Roman Yepishev
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-oops-tools
Fix Released
Critical
Roman Yepishev

Bug Description

STR:

1. Make OOPS with a URL that exceeds 500 characters
2. Receive an error from the database layer

Related branches

Aaron Bentley (abentley)
Changed in python-oops-tools:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Robert Collins (lifeless) wrote :

This is essentially an oops itself, but its in the meta-point; I'm going to categorise it as critical because if it *could* oops, it would be doing so.

Changed in python-oops-tools:
importance: High → Critical
Roman Yepishev (rye)
Changed in python-oops-tools:
assignee: nobody → Roman Yepishev (rye)
Revision history for this message
Roman Yepishev (rye) wrote :

--- src/oopstools/oops/models.py 2011-12-08 04:57:25 +0000
+++ src/oopstools/oops/models.py 2012-04-14 14:22:31 +0000
@@ -433,7 +433,8 @@
     # Trim most_expensive_statements to 200 characters
     if most_expensive_statement is not None:
         most_expensive_statement = conform(most_expensive_statement, 200)
- url = conform(oops.get('url') or '', MAX_URL_LEN)
+
+ url = oops.get('url') or ''
     if type(url) is unicode:
         # We have gotten a ringer, URL's are bytestrings. Encode to UTF8 to get
         # a bytestring and urllib.quote to get a url.
@@ -447,6 +448,7 @@
             # to quote it to make it a valid URL - this is better than
             # rejecting the OOPS, or having a URL that isn't in the DB.
             url = urllib.quote(url)
+ url = conform(url, MAX_URL_LEN)

     informational = oops.get('informational', 'False').lower() == 'true'
     oops_date = oops.get('time')

Revision history for this message
Haw Loeung (hloeung) wrote :
Download full text (3.2 KiB)

Hi,

I'm seeing this as well:

oops_tools@neem:/tmp$ ./oops_tools-production-run-amqp2disk.sh Failed while processing /srv/oops.canonical.com/oops-amqp/oops_tools/production/2012-05-24/OOPS-69c1c68e3d26c854d347cf644722d534
Traceback (most recent call last):
  File "/srv/oops.canonical.com/python-oops-tools/bin/amqp2disk", line 55, in <module>
    oopstools.scripts.amqp2disk.main()
  File "/srv/oops.canonical.com/python-oops-tools/src/oopstools/scripts/amqp2disk.py", line 113, in main
    receiver.run_forever()
  File "/srv/oops.canonical.com/python-oops-tools/eggs/oops_amqp-0.0.5-py2.7.egg/oops_amqp/receiver.py", line 85, in run_forever
    self._run_forever()
  File "/srv/oops.canonical.com/python-oops-tools/eggs/oops_amqp-0.0.5-py2.7.egg/oops_amqp/receiver.py", line 107, in _run_forever
    self.channel.wait()
  File "/srv/oops.canonical.com/python-oops-tools/eggs/amqplib-1.0.2-py2.7.egg/amqplib/client_0_8/abstract_channel.py", line 97, in wait
    return self.dispatch_method(method_sig, args, content)
  File "/srv/oops.canonical.com/python-oops-tools/eggs/amqplib-1.0.2-py2.7.egg/amqplib/client_0_8/abstract_channel.py", line 117, in dispatch_method
    return amqp_method(self, args, content)
  File "/srv/oops.canonical.com/python-oops-tools/eggs/amqplib-1.0.2-py2.7.egg/amqplib/client_0_8/channel.py", line 2060, in _basic_deliver
    func(msg)
  File "/srv/oops.canonical.com/python-oops-tools/eggs/oops_amqp-0.0.5-py2.7.egg/oops_amqp/receiver.py", line 70, in handle_report
    self.config.publish(report)
  File "/srv/oops.canonical.com/python-oops-tools/eggs/oops-0.0.10-py2.7.egg/oops/config.py", line 189, in publish
    id = publisher(report)
  File "/srv/oops.canonical.com/python-oops-tools/src/oopstools/scripts/amqp2disk.py", line 130, in db_publisher
    res = parsed_oops_to_model_oops(report, oops_path)
  File "/srv/oops.canonical.com/python-oops-tools/src/oopstools/oops/models.py", line 483, in parsed_oops_to_model_oops
    res.save()
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/models/base.py", line 553, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/models/query.py", line 1436, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/models/sql/compiler.py", line 791, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/srv/oops.canonical.com/python-oops-tools/parts/django/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor....

Read more...

Revision history for this message
Haw Loeung (hloeung) wrote :

rye's patch seemed to have fixed it.

Roman Yepishev (rye)
Changed in python-oops-tools:
status: Triaged → In Progress
Roman Yepishev (rye)
Changed in python-oops-tools:
status: In Progress → Fix Committed
Haw Loeung (hloeung)
Changed in python-oops-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.