ox-it / ords

Automatically exported from code.google.com/p/ords
0 stars 0 forks source link

Upload failure wipes existing tables #774

Closed MerielP closed 8 years ago

MerielP commented 8 years ago

In an attempt to reproduce a different bug, I've just uploaded a new CSV file to the database called 'Uploaded database made from CSV files', in the project 'Staging test' on Staging. The CSV file is one I've uploaded successfully on several other occasions.

When I went into the database page to see if it had finished uploading yet, I was somewhat disturbed to discover that the entire contents of the database had been wiped. There were two other tables in there, which have vanished completely. The database page looks as it would just after a new empty database has been created - it's inviting me to either upload a database or create one.

The email I got from ORDS said:


Hi Meriel Patrick

Unfortunately, the ORDS system has encountered a problem. Your database (artefact_catalogue) has not been imported. The page at https://staging.ords.ox.ac.uk/ordsProjectNode/commonProblems.jsp gives some suggestions on how to proceed if you are unsure how to fix this. The error reported was .

The ORDS Team

thestoat commented 8 years ago

Can you let me know how I might go about creating this? I have tried uploading some csv files to a database and all works as expected.

MerielP commented 8 years ago

I've attempted to retrace my steps, and have succeeded in reproducing the bug. I suspect it may be significant that after uploading the first two files, I made some changes to them before uploading the third, so I've attempted to record what I did in as much detail as possible:

  1. Upload CSV file called 'People'
  2. Upload CSV file called 'Places'
  3. Go into schema designer. Edit field names so they are all lower case with no spaces.
  4. Change the primary key of the 'People' table to the 'id' field. Change the 'id' field into an autoincrement integer field.
  5. Change the primary key of the 'Places' table to the 'place' field. (Leave the data type as text, as this field contains place names.)
  6. Create a relationship between the 'place' field in the 'Places' table and the 'residence' field in the 'People' table.
  7. Save changes, and exit the schema designer.
  8. (At this point, I went and viewed the 'People' table to check that the relationship was working as I intended. However, I didn't actually make any changes.)
  9. Upload CSV file called 'artefact_catalogue'

Both times I've done this, this caused the whole database to be wiped. The CSV files I used are attached below:

CSV files.zip

I've also just spotted that the error message didn't paste properly into the bug report above (part of the message that was in angle brackets has been edited out). Here's a screenshot of the email:

error message after file upload causing database wipe

thestoat commented 8 years ago

This is why developers shouldn't test their own code. I'd never have thought of doing something like that - and I would have been too scared to try even if I had have ...

thestoat commented 8 years ago

Ok, looks like this problem will happen by simply moving a table in the schema designer and then saving a few times.

thestoat commented 8 years ago

This should now be fixed ...

MerielP commented 8 years ago

Seems to be working as it should now - closing this issue.