1 (edited by BDeed 02-05-2013 16:51:59)

Topic: Tiny steps!

I took a break briefly as i had been struggling to get Indicia installed on a fasthosts server. I spent some time on it today and have been working through the tutorial.

While trying the tabbed data entry i received the following error on 'submit'

An error occurred
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]
Define trailer text in mnhnl_dynamic_1.en.php


As far as i am aware all the tables installed without problems and i have had no error messages. I strongly suspect i have missed something but i can't figure out what! Be easy on the novice!

installed 0.8.2

There is a slight issue that fasthosts seem to hide the database out of reach. I needed to enter an ip at the db configuration stage? Though after that the installation ran fine.

I'm actually out of office until Tues now so i apologise in advance for not getting back sooner!


--
I'd just also like to check, there are two links (with non-displaying images) to French websites... should they be there?

Natural History & Biodiversity Data Enthusiast

2

Re: Tiny steps!

Hi
The error you are getting actually indicates that a query ran against the database just beforehand which failed, so it doesn't tell you much. The way to find out what is going on is to find the file, application\config\config.php then open it in a text editor. Now, search for $config['log_threshold'] and set the value to 4, then save the file. Now, recreate the error, and look in the log file with today's date, under application/logs/. This will contain the "current transaction is aborted" error near the bottom, and just above it hopefully the real error message which caused the original problem. If you post that chunk of the log here I'll see if I can help.

One thought though - would you prefer a test account on BRC's test warehouse so you don't have to mess around with configuring your own warehouse? This might be an easier way to get started.

Cheers
John

John van Breda
Biodiverse IT

3 (edited by BDeed 02-05-2013 17:05:17)

Re: Tiny steps!

Hi John,

Jim has set me up with a test warehouse which is all working fine. Cant seem to find a config.php file anywhere though?

Thanks,

Ben

Natural History & Biodiversity Data Enthusiast

4

Re: Tiny steps!

I have found an error log that seems to contain some info.

[Fri May 03 14:51:08 2013] [error] [client *] File does not exist: */htdocs/sites/all/files, referer: *?q=submit-sightings-tabbed
[Fri May 03 14:51:08 2013] [error] [client *] File does not exist: */htdocs/sites/all/modules/iform/client_helpers, referer: *submit-sightings-tabbed

I seem to just be missing some files. Is it likely i have missed a step in the installation?

Natural History & Biodiversity Data Enthusiast

5 (edited by BDeed 03-05-2013 14:34:56)

Re: Tiny steps!

After checking through the forum for "helper_config" i noted i was missing the php from sites/all/modules/iforms with this added i am getting the same error on the submission page (recreated the iform just in case).

The error is now:

[Fri May 03 15:05:29 2013] [error] [client *] File does not exist: */htdocs/function.require-once, referer:
Natural History & Biodiversity Data Enthusiast

6

Re: Tiny steps!

Hi
I think you are correct in that it looks like you have not got a complete installation. Perhaps you could let us know how you got your installation to the point it is at now - for example, did you install Instant Indicia or set it up yourself?
Best wishes
John

John van Breda
Biodiverse IT

7

Re: Tiny steps!

Hi John,

Jim set me up with the warehouse on the test server at BRC. The Indicia Installation was installed clean using the 0.8.2. download. All I've done is upload the files via ftp and then work through the instructions in the basic tutorial section 4.

I'm on a shared server so db was set up using CPanel, though it set it up in a separate location which i have had to specify in the Database configuration (Advanced options).

Cheers,

Ben

Natural History & Biodiversity Data Enthusiast

8

Re: Tiny steps!

Hi Ben,

Just reading through the above having been away a few days.
I have a couple of general points which elaborate slightly to start with.

a. In John's initial comment he was assuming you had your own warehouse. The file and settings he was talking about will not exist in your Instant Indicia installation.

b. The confusion arose because Indicia is the whole thing and it was not clear that you meant Instant Indicia as opposed to the Indicia Warehouse.

c. The tutorial that you are working through is a little dated and Indicia is changing fast. Try substituting the Dynamic Sample with Occurrences from for the MNHNL (Musée national d'histoire naturelle Luxembourg) form that you are using. (No more French links)

d. You can't have been missing the iForm module if you had created a recording form.

Now, to your more specific problem, the following information is aimed at John. You don't need to try to understand it, Ben, suffice it to say that the problem may now be fixed.

Going back to the warehouse log of 2nd April I see the following associated with each instance of the bit of error message that Ben has been able to see

2013-05-02 17:25:25 +01:00 --- debug: Record did not validate
2013-05-02 17:25:25 +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)=(0) is not present in table "users". 

Ben won't have enabled the  Easy Login Module and I can see from the log that the warehouse is being passed a user_id that is an empty string as would be expected since data_entry_helper::forward_post_to sends

$postargs .= '&user_id='.hostsite_get_user_field('indicia_user_id');

and hostsite_get_user_field will have returned false that will convert to an empty string.

The recent change, r5628, checks to see if this value is set, which it is, albeit to an empty string, where previously a boolean test was used that would have evaluated to false. Since the outcome of the test has changed yet no value is assigned to the user id this leads to the error that Ben is seeing. This is all just code inspection on my part but, if my theory is correct, this means that no submissions to the warehouse from a non-logged in user on a Drupal site are currently possible.

Tried this on iRecord and found I could submit an anonymous record. Line 129 of application/controllers/service_base.php on warehouse1 reads

if (isset($_REQUEST['user_id']) && $_REQUEST['user_id'])

You must have been here already! This fixes the problem by reintroducing the boolean test but it has not been applied to testwarehouse (I just applied it) and it has not been committed to the repository (would you please).


Jim Bacon

9

Re: Tiny steps!

Hi Jim,

Cheers for that. Seems to be working at my end, will move on to trying out some more.

Thanks both for your help.

Ben

Natural History & Biodiversity Data Enthusiast