Red Queen Review Engine User Manual

TROUBLESHOOTING

Adjust Text:  a a a a
« Table of Contents   |   Obtain Red Queen »


TROUBLESHOOTING

As Red Queen becomes more widely used, and issues are addressed regarding its use in various situations, this page will grow.

I see CGI source code when I run Red Queen

Presently Red Queen is meant to be run as a CGI application, so it should be installed into a directory that your web server regards as a "CGI bin". This means that the web server will assume that any request for a file in such a directory is a request to execute the file as a script, and the generated output is to be sent to the browser. If the directory into which Red Queen has been installed is NOT a CGI bin, the web server will regard the HTTP request as one for the content of the file, and you will see Perl source code appear in your browser. Either install Red Queen into a CGI bin, or have your web host convert the directory into a CGI bin.

I get a 500 Internal Server Error

You will get a 500 type error message when your script cannot be executed as a script. There are several possible reasons why this might be the case. If you did not upload your executable scripts as ASCII, then the first line of these scripts (which contain the path to your perl interpreter) will not be correctly parsed and the web server will not know how to run the program. Another possibility is that the web server does not have sufficient permissions to execute the program (generally after uploading a script you should chmod it to 755 so that the web server has permission to read and execute the script). In this case you will usually get a "Permission denied" type of error message. A final possibility is that the first line of your executable script simply contains the wrong path to your perl interpreter. In that case, all you need to do is replace it with the correct path. See the Installation Instructions for a fuller discussion of installation-related issues.

My Build process never completes

If you are attempting to perform a Staggered Build via the browser, the page should refresh itself after building static pages for all Items (or Members, or Suppliers) in the current batch of Categories (or Teams, or Yellow Pages). If the web server process dies with a non-useful error message it may be that it has simply timed out. In this case you can try reducing the number of Categories processed per browser page refresh. If you are already processing a single Category for each browser page, then check the size of the category. Very large categories can be a problem with the current Staggered build algorithm. If you cannot reduce the size of the Category because it is impractical for any reason, then consider performing the build via the telnet command line.

Telnet into your account, and go to your Red Queen admin directory

cd /path/to/cgi-bin/rs/redqueen/do/admin

Then issue this command to build all pages that require building:

perl nph-admin.cgi --do=BuildAll

If the process runs out of memory before completing (less likely, but it can happen if you have a large Red Queen database) then set the build_expiration_in_minutes configuration variable to some value like 90 (or roughly twice the time--in minutes--that a build is expected to take) and redo the build. If you restart a failed build within the expiration time it will pick up where it left off. If you need to restart a build from scratch before the expiration time has passed you set the expiration time back to zero.

My Build process never begins

If you are attempting to build pages via the browser, check whether you need to switch off (or on) the nph headers that are normally used for building and indexing via the browser. Usually nph headers are required, but on some web servers they must be switched off before the web server can properly return the requested results.

Also, if you decide to switch between browser-based building and command-line building don't expect to get anywhere unless the process executes as the SAME user in both cases. Why? Because if one process builds static files which are then owned by user A, and then the other process attempts to overwrite those same files as user B, permissions on the files will likely prohibit any overwriting from taking place and the process may seem to die mysteriously (unless you have 777 permissions on everything). Generally both processes on a server will execute as the same user, but I have spent hours looking for problems in code when it has turned out that conflicting user identities are the cause of the problem.

My thumbnails are low quality

The quality of your thumbnails is dependent on the vagaries of the image library used to create the thumbnail from the original image. As an example, in the case of the GD library, the method used to perform the sampling is copyResampled() IF it is available. copyResampled() smoothes the merged pixels to produce nice images, but the method is not available in earlier versions of the GD library. In that case copyResized() is used instead and the result may not be as good. For Image::Magick the thumbnailing method used will be Thumbnail() if it is available, else Resize(), or, neither of those two are available, Scale().

I cannot thumbnail GIF images

If you are using an image library from which GIF file support has been removed you will run into problems when trying to manipulate GIF files. For a period (when the patent was enforced on the GIF algorithm) libraries such as GD removed the support for this image format. Now that the patent has expired, the format should become available again, but whether or not it does will obviously depend on the version of the library you are using. Check with your web host to find out whether GIF support is included in the image library you are using (i.e. Image::Magick, GD, or NetPBM).

Why is my Top Reviewers Page not working?

The table containing data for the Top Reviewers page is not automatically rebuilt unless you have set up a cron job to handle the process. See the section in the Manual dealing explicitly with the Top Reviewer options. However, you can also recreate the top reviewers table by going to the Miscellanous control panel. Once you've rebuilt it you should see the expected listing of reviewers on the Top Reviewers page.

Why is sendmail not working?

The most common problem encountered when setting up sendmail with Red Queen is erroneously specifying the path to the sendmail directory instead of the path for the sendmail application itself. This means you generally need to specify /usr/sbin/sendmail or /usr/sbin/qmail-inject, and NOT merely /usr/sbin. If you specify a path that does not point to an executable application on your system you will see a message like "note: not exectuable!" next to the configuration variable named email_sendmail_path.

I get a LOCK TABLES error

Certain database operations are preceeded by a table lock. When this is the case, it is because we want to guarantee that those components of the data that need to be unique to a table remain unique between the time the user supplies it and the time it actually gets recorded. If you see a database error that mentions the LOCK TABLES statement and contains a line like this: Access denied for user: 'my_db_username@my_db_host' to database 'my_db_database' (where the my_db variables are standins for your actual database parameters), then likely your webserver (logging into the MySQL server as you) does not have sufficient database privileges to LOCK TABLES. You need to change that. Ask your web host to do this for you, or if you have root access to your MySQL server, issue the following statement from the command line to add the LOCK TABLES privilege:

GRANT LOCK TABLES ON 'my_db_database'.* TO 'my_db_username'@'my_db_host' IDENTIFIED BY 'my_dbpassword';

You might also find this page useful for a brief intro to the privileges you can grant a MySQL user: MySQL Table Privileges

I get a CREATE TEMPORARY TABLE error

In the same way that your MySQL user must have the LOCK TABLES permission in order to lock tables, the MySQL user must asl have the CREATE TEMPORARY TABLES privilege in order to create a TEMPORARY TABLE (sometimes used for sorting purposes). If you see a database error that mentions a CREATE TEMPORARY TABLE statement and contains a line like this: Access denied for user: 'my_db_username@my_db_host' to database 'my_db_database' (where the my_db variables are standins for your actual database parameters), then likely your webserver (logging into the MySQL server as you) does not have sufficient database privileges to create a TEMPORARY TABLE. You need to change that. Ask your web host to do this for you, or if you have root access to your MySQL server, issue the following statement from the command line to add the CREATE TEMPORARY TABLES privilege:

GRANT CREATE TEMPORARY TABLES ON 'my_db_database'.* TO 'my_db_username'@'my_db_host' IDENTIFIED BY 'my_dbpassword';

You might also find this page useful for a brief intro to the privileges you can grant a MySQL user: MySQL Table Privileges

I see Weird Characters Displayed

Depending on the machine on which Red Queen is installed, you may see "accented characters" display oddly in your browser pages. In that case, visit the Configure > Miscellanous control panel and elect to have these characters translated to unicode before being displayed.

I see 'regex' Errors when Adding Items

For fields that are required to have a value when adding a record to the database, oftentimes there is an accompanying regular expression check carried out on the value supplied for that field just prior to adding the record to the database. This check is to ensure that the supplied data is of the right format.

For example, if only an integer expression should be supplied for the field, the regular expression (see the 'regex' option on the column definition page) would be ^\d+$ which means "one or more sequential digits and nothing else between the start ^ and end $ of the string". If your supplied data fails the regular expression check you'll get an error message to that effect. In that case you should change the definition of the column from Not Null = 'Yes' to Not Null = 'No' (i.e. from values are Required to values are Not Required) if you don't always want to be forced to suppply a value for the column in question.

Also you'll either need to delete the regexp altogether, or amend it so that it works for the kind of data you want to add for that column. For instance, if I were to have a column that might or might not have an integer associated with it, it would be a VARCHAR column of some length, the value would be Not Null = 'No' and the regex would be ^(\d+|)$ meaning the same as before but "also allow the empty string through" so that if we supply a value it MUST be an integer, but not supplying a value is OK too.

I get a DBI error

There could be a lot of reasons for this, but here are some of the common ones:

  • Error: Exception: Modification of a read-only value attempted at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBI.pm line 279.

    Soln: If you looked at line 279 in the Perl DBI module you would likely see something that looked like this:

    Scalar::Util::weaken(my $test = \"foo");

    Your Perl is complaining because it has an old copy of the class Scalar::Util and the weaken() method is absent. Update the Scalar::Util class and you should be back in action. Ask your web hosting company to do this for you, if necessary.

I cannot Upload Files

If you cannot upload a file for a PARTICULAR record, but you can for other records, it is likely that the record in question (let us pretend it is the Item table we are dealing with) already has an Upload ID for the column that will represent the uploaded file, but the file itself is not recorded in the Upload table. In other words, the Upload ID in the Item table is orphaned.

You can see this when you list the records in the Item table (from the Database control panel). Records with an uploaded file show the file name for the value of the column, but for the problem record the value associated with the column is an integer, say 18 (the Upload ID). If you spot this happening you know exactly what the problem is: you need to remove that orphaned Upload ID. To do this, login to MySQL via the command line and issue a query like this (assuming the record in question was Item.id = 10 and the upload column was the image column Item.item_image):

UPDATE rq_Item SET item_image = NULL WHERE id = 10;

Make sure you have correctly identified the revelant upload column and the record in question before you issue your query. You can also look at the Upload table itself and verify that there is no record with Upload.id = 18

The SQL query will remove the orphaned reference to record 18 from the Item table and you'll be able to upload again for that Item record. Make sure you get the query right--you definitely don't want to NULLify all the item_image columns!

Alternately, if you have phpmyadmin, or something like that, you can edit the Item table that way and make the modification. But you cannot do it in Red Queen because upload columns are managed by the Upload Manager and it does not function correctly when the referenced record is missing.

If you find that the Upload Manager will not upload a particular file, no matter what the record you are trying to attach it to, the problem may be one of the following:

  • The file is peculiar in some way. Most files have a standard way of identifying their content to a client that attempts to read them. If for some reason the client (such as your image manipulation library) does not recognize the file header, it may just throw an exception an do nothing. In which case, try another file, or another version of the same file...
  • The file is too large. There are maximum file size specifications in the UploadType table for each file MIME type. If necessary, adjust the maximum permitted file size (in bytes). There are also maximum dimensional size specifications for certain image columns. See the Configure > Avatars / Logos page for more information.
  • If no image will upload, go to the Configure > Thumbnails control panel and check that you thumbnailing solution works on the 3 example images shown on that page. It is possible that your image manipulation library does not support a certain image type.

My Template Modifications Don't Take

The way the templates work is that Template Toolkit will cache a compiled version of each template the first time the template is used after having been modified in any way. This caching makes things just a bit more speedy. However, I have seen instances of Red Queen deployment where Template Toolkit seems not to be aware of newly made changes to templates, and it continues to serve up the cached version that is no longer valid. If this appears to be happening you can simply delete the cached template.

Cached templates are stored in /cgi-bin/rs/redqueen/perl

In the /perl directory you will find subdirectories that contain the fill path of a compiled template, often begining as /home and ending in the name of the template but with a .ttml_cp extension to indicate that this is a compiled template containing perl code.

You can delete any compiled template and it will reappear the first time a page is generated that requires the template. You can evern delete the entire /perl directory and it will eventually come back. The directory is managed by the Template Toolkit.

« Table of Contents   |   Obtain Red Queen »


Copyright © 2004 Random Mouse Software. All Rights Reserved.