Moodle
  1. Moodle
  2. MDL-30521

Cron crash fetching external blog entries

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Administration
    • Labels:
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      Step 1:

      1. Install a stable 1.9 site and upgrade it to 2.1 integration
      2. In the database check post.uniquehash is 255 chars
      3. Perform step 2 on this branch
      4. Install a stable 1.9 site and Upgrade it to 2.2 integration
      5. In the database check post.uniquehash is 255 chars
      6. Perform step 2 on this branch
      7. Install a stable 2.2 site and upgrade it to integration master
      8. In the database check post.uniquehash is 255 chars
      9. Perform step 2 on this branch

      Step 2:

      1. Log in as admin
      2. Enable external blogs (Site administration -> Appearance -> Blog)
      3. Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
      4. run cron
      5. It should not crash, keep an eye on error logs.
      6. Do the above in 21, 22, and master
      Show
      Step 1: Install a stable 1.9 site and upgrade it to 2.1 integration In the database check post.uniquehash is 255 chars Perform step 2 on this branch Install a stable 1.9 site and Upgrade it to 2.2 integration In the database check post.uniquehash is 255 chars Perform step 2 on this branch Install a stable 2.2 site and upgrade it to integration master In the database check post.uniquehash is 255 chars Perform step 2 on this branch Step 2: Log in as admin Enable external blogs (Site administration -> Appearance -> Blog) Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs) run cron It should not crash, keep an eye on error logs. Do the above in 21, 22, and master
    • Workaround:
      Hide

      Change the field type from fields "uniquehash" and "subject" from "varchar(128)" to "text"

      Show
      Change the field type from fields "uniquehash" and "subject" from "varchar(128)" to "text"
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-mdl-30521
    • Rank:
      33230

      Description

      Cron crashes when fetching external blog entries (errors in Spanish):

      Fetching external blog entries...
      Default exception handler: Error al escribir a la base de datos
      Debug: ERROR: value too long for type character varying(128)
      INSERT INTO mdl_post (userid,module,content,uniquehash,publishstate,format,subject,summary,created,lastmodified) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10) RETURNING id
      [array (
      'userid' => '231',
      'module' => 'blog_external',
      'content' => '4',
      'uniquehash' => 'http://feedproxy.google.com/~r/ElBlogDeEnriqueDans/~3/q2GdlIn_5Rc/la-censura-en-nombre-del-copyright-supone-una-violacion-de-los-derechos-fundamentales.html',
      'publishstate' => 'site',
      'format' => '1',
      'subject' => 'La censura en nombre del copyright supone una violación de los derechos fundamentales',
      'summary' => 'Mientras una filtración asegura que en España intentan aprovechar los “minutos de la basura” del gobierno en funciones para darle el último empujón a una ley Sinde absurda que nunca debió llegar a iniciar su tramitación, desde Europa al menos nos llegan buenas noticias: el Tribunal de Justicia de la Unión Europea (ECJ) ha determinado [...]',
      'created' => 1322120525,
      'lastmodified' => 1322120525,
      )]

      • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      • line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      • line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
      • line 252 of /blog/lib.php: call to pgsql_native_moodle_database->insert_record()
      • line 410 of /lib/cronlib.php: call to blog_sync_external_entries()
      • line 61 of /admin/cli/cron.php: call to cron_run()

      !!! Error al escribir a la base de datos !!!

      The problem seems clear... When inserting the "uniquehash" field, the text is longer than 128 chars. In fact, we think this would happen with almost all RSS URLs, because they are generated with the title of the blog post (and the title can be very long!).

      We are considering changing the field type to "text", because this probably would resolve the problem (PostgreSQL doesn't allow to "alter column" increasing the size).

      This issue may affect the "subject" field too.

      The issue is reported as "Blocker" because, since the cron crashes, no RSS feeds are updated...

        Issue Links

          Activity

          Carlos Lopez created issue -
          Carlos Lopez made changes -
          Field Original Value New Value
          Description Cron crashes when fetching external blog entries (errors in Spanish):


          Fetching external blog entries...
          Default exception handler: Error al escribir a la base de datos
          Debug: ERROR: value too long for type character varying(128)
          INSERT INTO mdl_post (userid,module,content,uniquehash,publishstate,format,subject,summary,created,lastmodified) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10) RETURNING id
          [array (
            'userid' => '231',
            'module' => 'blog_external',
            'content' => '4',
            'uniquehash' => 'http://feedproxy.google.com/~r/ElBlogDeEnriqueDans/~3/q2GdlIn_5Rc/la-censura-en-nombre-del-copyright-supone-una-violacion-de-los-derechos-fundamentales.html',
            'publishstate' => 'site',
            'format' => '1',
            'subject' => 'La censura en nombre del copyright supone una violación de los derechos fundamentales',
            'summary' => 'Mientras una filtración asegura que en España intentan aprovechar los “minutos de la basura” del gobierno en funciones para darle el último empujón a una ley Sinde absurda que nunca debió llegar a iniciar su tramitación, desde Europa al menos nos llegan buenas noticias: el Tribunal de Justicia de la Unión Europea (ECJ) ha determinado [...]',
            'created' => 1322120525,
            'lastmodified' => 1322120525,
          )]
          * line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
          * line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          * line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          * line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
          * line 252 of /blog/lib.php: call to pgsql_native_moodle_database->insert_record()
          * line 410 of /lib/cronlib.php: call to blog_sync_external_entries()
          * line 61 of /admin/cli/cron.php: call to cron_run()

          !!! Error al escribir a la base de datos !!!


          The problem seems clear... When inserting the "uniquehash" field, the text is longer than 128 chars. In fact, we think this would happen with almost all RSS URLs, because they are generated with the title of the blog post (and the title can be very long!).

          We are considering changing the field type to "text", because this probably would resolve the problem (PostgreSQL doesn't allow to "alter column" increasing the size).

          This issue may affect the "subject" field too.
          Cron crashes when fetching external blog entries (errors in Spanish):


          Fetching external blog entries...
          Default exception handler: Error al escribir a la base de datos
          Debug: ERROR: value too long for type character varying(128)
          INSERT INTO mdl_post (userid,module,content,uniquehash,publishstate,format,subject,summary,created,lastmodified) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10) RETURNING id
          [array (
            'userid' => '231',
            'module' => 'blog_external',
            'content' => '4',
            'uniquehash' => 'http://feedproxy.google.com/~r/ElBlogDeEnriqueDans/~3/q2GdlIn_5Rc/la-censura-en-nombre-del-copyright-supone-una-violacion-de-los-derechos-fundamentales.html',
            'publishstate' => 'site',
            'format' => '1',
            'subject' => 'La censura en nombre del copyright supone una violación de los derechos fundamentales',
            'summary' => 'Mientras una filtración asegura que en España intentan aprovechar los “minutos de la basura” del gobierno en funciones para darle el último empujón a una ley Sinde absurda que nunca debió llegar a iniciar su tramitación, desde Europa al menos nos llegan buenas noticias: el Tribunal de Justicia de la Unión Europea (ECJ) ha determinado [...]',
            'created' => 1322120525,
            'lastmodified' => 1322120525,
          )]
          * line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
          * line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          * line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          * line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
          * line 252 of /blog/lib.php: call to pgsql_native_moodle_database->insert_record()
          * line 410 of /lib/cronlib.php: call to blog_sync_external_entries()
          * line 61 of /admin/cli/cron.php: call to cron_run()

          !!! Error al escribir a la base de datos !!!


          The problem seems clear... When inserting the "uniquehash" field, the text is longer than 128 chars. In fact, we think this would happen with almost all RSS URLs, because they are generated with the title of the blog post (and the title can be very long!).

          We are considering changing the field type to "text", because this probably would resolve the problem (PostgreSQL doesn't allow to "alter column" increasing the size).

          This issue may affect the "subject" field too.

          The issue is reported as "Blocker" because, since the cron crashes, no RSS feeds are updated...
          Priority Minor [ 4 ] Blocker [ 1 ]
          Carlos Lopez made changes -
          Labels blog cron
          Charles Fulton made changes -
          Link This issue duplicates MDL-28638 [ MDL-28638 ]
          Rajesh Taneja made changes -
          Fix Version/s STABLE Sprint 17 [ 11550 ]
          Rajesh Taneja made changes -
          Status Open [ 1 ] Development in progress [ 3 ]
          Rajesh Taneja made changes -
          Pull Master Diff URL https://github.com/rajeshtaneja/moodle/compare/master...wip-mdl-30521
          Pull Master Branch wip-mdl-30521
          Pull 2.2 Diff URL https://github.com/rajeshtaneja/moodle/compare/MOODLE_22_STABLE...wip-mdl-30521-m22
          Pull 2.1 Branch wip-mdl-30521-m21
          Pull 2.2 Branch wip-mdl-30521-m22
          Pull 2.1 Diff URL https://github.com/rajeshtaneja/moodle/compare/MOODLE_21_STABLE...wip-mdl-30521-m21
          Pull from Repository git://github.com/rajeshtaneja/moodle.git
          Rajesh Taneja made changes -
          Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
          Jason Fowler made changes -
          Original Estimate 0 minutes [ 0 ]
          Remaining Estimate 0 minutes [ 0 ]
          Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
          Peer reviewer phalacee
          Jason Fowler made changes -
          Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
          Rajesh Taneja made changes -
          Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
          Testing Instructions - Add a external blog in your profile: http://feeds.feedburner.com/ElBlogDeEnriqueDans. The entry that crashes in our cron comes from this blog.
          - Launch cron
          - Crash!
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          Eloy Lafuente (stronk7) made changes -
          Currently in integration Yes [ 10041 ]
          Sam Hemelryk made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Integrator samhemelryk
          Sam Hemelryk made changes -
          Status Integration review in progress [ 10004 ] Reopened [ 4 ]
          Rajesh Taneja made changes -
          Status Reopened [ 4 ] Development in progress [ 3 ]
          Eloy Lafuente (stronk7) made changes -
          Currently in integration Yes [ 10041 ]
          Rajesh Taneja made changes -
          Link This issue is a regression caused by MDL-24875 [ MDL-24875 ]
          Rajesh Taneja made changes -
          Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
          Jason Fowler made changes -
          Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
          Jason Fowler made changes -
          Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
          Rajesh Taneja made changes -
          Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
          Sam Hemelryk made changes -
          Currently in integration Yes [ 10041 ]
          Sam Hemelryk made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Sam Hemelryk made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Fix Version/s 2.1.5 [ 11553 ]
          Fix Version/s 2.2.2 [ 11552 ]
          Sam Hemelryk made changes -
          Testing Instructions # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # Check post.uniquehash is 255 chars
          # Upgrade it to 2.2
          # Check post.uniquehash is 255 chars
          # Upgrade it to master
          # Check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # Check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Michael de Raadt made changes -
          Tester gerry
          Gerard Caulfield made changes -
          Testing Instructions Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # Check post.uniquehash is 255 chars
          # Upgrade it to 2.2
          # Check post.uniquehash is 255 chars
          # Upgrade it to master
          # Check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # Check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to 2.2
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to master
          # In the database check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Gerard Caulfield made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Gerard Caulfield made changes -
          Testing Instructions Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to 2.2
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to master
          # In the database check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (Settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to 2.2
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to master
          # In the database check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Rajesh Taneja made changes -
          Testing Instructions Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to 2.2
          # In the database check post.uniquehash is 255 chars
          # Upgrade it to master
          # In the database check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # In the database check post.uniquehash is 255 chars
          # Install a 1.9 site and Upgrade it to 2.2
          # In the database check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Rajesh Taneja made changes -
          Testing Instructions Step 1:
          # Install a 1.9 site and upgrade it to 2.1
          # In the database check post.uniquehash is 255 chars
          # Install a 1.9 site and Upgrade it to 2.2
          # In the database check post.uniquehash is 255 chars
          # Install a 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Step 1:
          # Install a stable 1.9 site and upgrade it to 2.1 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 1.9 site and Upgrade it to 2.2 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Gerard Caulfield made changes -
          Testing Instructions Step 1:
          # Install a stable 1.9 site and upgrade it to 2.1 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 1.9 site and Upgrade it to 2.2 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 2.2 site and upgrade it to master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Step 1:
          # Install a stable 1.9 site and upgrade it to 2.1 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 1.9 site and Upgrade it to 2.2 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 2.2 site and upgrade it to integration master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Gerard Caulfield made changes -
          Testing Instructions Step 1:
          # Install a stable 1.9 site and upgrade it to 2.1 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 1.9 site and Upgrade it to 2.2 integration
          # In the database check post.uniquehash is 255 chars
          # Install a stable 2.2 site and upgrade it to integration master
          # In the database check post.uniquehash is 255 chars

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Step 1:
          # Install a stable 1.9 site and upgrade it to 2.1 integration
          # In the database check post.uniquehash is 255 chars
          # Perform step 2 on this branch
          # Install a stable 1.9 site and Upgrade it to 2.2 integration
          # In the database check post.uniquehash is 255 chars
          # Perform step 2 on this branch
          # Install a stable 2.2 site and upgrade it to integration master
          # In the database check post.uniquehash is 255 chars
          # Perform step 2 on this branch

          Step 2:
          # Log in as admin
          # Enable external blogs (Site administration -> Appearance -> Blog)
          # Add external blog in your profile http://feeds.feedburner.com/ElBlogDeEnriqueDans (My profile settings -> Blogs -> External blogs)
          # run cron
          # It should not crash, keep an eye on error logs.
          # Do the above in 21, 22, and master
          Gerard Caulfield made changes -
          Status Testing in progress [ 10011 ] Tested [ 10006 ]
          Eloy Lafuente (stronk7) made changes -
          Status Tested [ 10006 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Currently in integration Yes [ 10041 ]
          Integration date 23/Feb/12
          Eloy Lafuente (stronk7) made changes -
          Fix Version/s STABLE Sprint 17 [ 11550 ]

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: