1

Topic: Error on Report Submission

Hi all,

I'm currently testing out a survey using the test warehouse. However, when I submit the survey from my Indicia form I get a message:

There was an SQL error: ERROR: current transaction is aborted, commands ignored until end of transaction block - SELECT table_schema || '.' || table_name FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
[sample:general]

Can you help me interpret what's causing this error or suggest any ways I could fix it?

I'm using the General Purpose Data Entry Forms > Sample With Occurrences Form from the Indicia Drupal module, which I've defined the layout of like this:

=Where Were You?=
?Tell us about the location where your sightings were made. You can enter a lat/long reference directly for your location, or search for a place then click on the map to set it.?
[smpAttr:345]
@smpAttr:345|helpText=Tell us what you were doing when you made your sighting(s).
[date]
@label=The date of your sightings
@helpText=Use the dropdown box to select a date.
[location name]
[spatial reference]
@label=Co-ordinates
@helpText=The most accurate method is to use the map below to click on the location of your sightings.
[place search]
@helpText=You can search for your location using this box. Enter the location name and click Search.
[map]
[*]
=Species=
?Please use the autocomplete box below to enter species names and tell us about the species that you saw.?
[species]
@resizeWidth=1500
@resizeHeight=1500
[species attributes]
[*]

Can anyone help?

Thanks,

Steve

2

Re: Error on Report Submission

Hi Steve,

If you go to the warehouse website interface and go to the Admin menu, do you have a Browse Server Logs option? I'm not sure if your permissions grant you access to this.

If so you get a whole lot more information

2014-05-23 12:42:21 +01:00 --- debug: Record did not validate

2014-05-23 12:42:21 +01:00 --- debug: Field general: There was an SQL error: ERROR:  insert or update on table "samples" violates foreign key constraint "fk_sample_creator"

DETAIL:  Key (created_by_id)=(160) is not present in table "users". 

INSERT INTO "samples" ("created_on", "created_by_id", "updated_on", "updated_by_id", "date_end", "location_name", "survey_id", "sample_method_id", "input_form", "entered_sref", "geom", "entered_sref_system", "date_start", "date_type") VALUES ('20140523 12:42:21', 160, '20140523 12:42:21', 160, '2014-05-23', 'TEST', 176, 25, 'node/1', 'NT28', '0103...41', 'OSGB', '2014-05-23', 'D')

2014-05-23 12:42:21 +01:00 --- error: #44: Exception during inner_submit.. There was an SQL error: ERROR:  current transaction is aborted, commands ignored until end of transaction block - SELECT table_schema || '.' || table_name FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog', 'information_schema') at line 342 in file D:\web sites\indicia\content\system\libraries\drivers\Database\Pgsql.php

There is, indeed, no user 160 in the testwarehouse. Your person_id is 160 but your user_id is 180. I don't know if this provides you any clue.

Are you using Drupal and the Easy Login module? If so, that normally manages your user_id.

Jim Bacon.

3

Re: Error on Report Submission

Thanks Jim, that did point me in the right direction!

This might be useful for anyone else who finds themselves with the same error: I had created a user account with standard permissions rather than using the admin account, for testing, but I'd created it through the "create new user" menu in Drupal rather than by applying for membership through the application screen. I guess that the Easy Login module hooks onto the application process, so an account hadn't been made in Indicia for the new account, which caused the problem.

Thanks for pointing me to towards the server logs in Indicia - I hadn't spotted it before!