PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
203 stars 235 forks source link

Issue with PEcAn pft test script (../tests/testpfts.R) with latest BETYdb schema #522

Closed serbinsh closed 9 years ago

serbinsh commented 9 years ago

I am receiving this error when running the test script with the latest version of BETYdb:

2015-06-30 11:04:52 INFO   [FUN] :
   4 observations of quantum_efficiency
Error in postgresqlExecStatement(conn, statement, ...) :
  RS-DBI driver: (could not Retrieve the result : ERROR:  new row for relation "dbfiles" violates check constraint "file_path_sanity_check"
DETAIL:  Failing row contains (2000000050, prior.distns.csv, testpfts/posterior/2000000008, null, null, null, 2000000001, 2015-06-30 11:04:52, 2015-06-30 11:04:52, Posterior, 2000000008).
)
In addition: Warning message:
In postgresqlQuickSQL(conn, statement, ...) :
  Could not create executeINSERT INTO dbfiles (container_type, container_id, file_name, file_path, machine_id, created_at, updated_at) VALUES ('Posterior', 2000000007, 'prior.distns.csv', 'testpfts/posterior/2000000007', 2000000001, '2015-06-30 11:04:52', '2015-06-30 11:04:52')
2015-06-30 11:04:52 SEVERE [db.query] :
   Error executing db query 'INSERT INTO dbfiles (container_type,
   container_id, file_name, file_path, machine_id, created_at, updated_at)
   VALUES ('Posterior', 2000000008, 'prior.distns.csv',
   'testpfts/posterior/2000000008', 2000000001, '2015-06-30 11:04:52',
   '2015-06-30 11:04:52')' errorcode=0 message='ERROR: new row for relation
   "dbfiles" violates check constraint "file_path_sanity_check" DETAIL:
   Failing row contains (2000000050, prior.distns.csv,
   testpfts/posterior/2000000008, null, null, null, 2000000001, 2015-06-30
   11:04:52, 2015-06-30 11:04:52, Posterior, 2000000008). '
TESTING [id=  5 pft='ebifarm.nfixer' model='ED2'] : BROKEN - Error executing db query 'INSERT INTO dbfiles (container_type, container_id, file_name, file_path, machine_id, created_at, updated_at) VALUES ('Posterior', 2000000008, 'prior.distns.csv', 'testpfts/posterior/2000000008', 2000000001, '2015-06-30 11:04:52', '2015-06-30 11:04:52')' errorcode=0 message='ERROR:  new row for relation "dbfiles" violates check constraint "file_path_sanity_check"
DETAIL:  Failing row contains (2000000050, prior.distns.csv, testpfts/posterior/2000000008, null, null, null, 2000000001, 2015-06-30 11:04:52, 2015-06-30 11:04:52, Posterior, 2000000008).
'
2015-06-30 11:04:52 WARN   [testpfts.R#23: db.close] :
   Connection created outside of PEcAn.db package
TESTING [id=  6 pft='ebifarm.c4grass' model='ED2'] : get.traits

Looks like an issue recording results with BETY?

serbinsh commented 9 years ago

message='ERROR: new row for relation "dbfiles" violates check constraint "file_path_sanity_check"

mdietze commented 9 years ago

Yeah, Scott just added a bunch more constraints, one of which got rid of the ability to make a lot of things NULL. So I suspect one or more of those NULLs in the insert needs to be empty quotes instead. I think you're the first to run this script since the constraints were added, so if you get a fix it would be great if you could check it in

serbinsh commented 9 years ago

@mdietze Looking into it today

robkooper commented 9 years ago

this is indeed related to the new constraints. have a potential fix ready

robkooper commented 9 years ago

pull and see if this fixes it.

serbinsh commented 9 years ago

Working OK for me now.