Closed dnowacki-usgs closed 5 years ago
@tomkralidis, do you have a suggestion on how we should fix the ERROR: too many SQL variables
error? Basically we are just trying to wipe all the records in the database.
@rsignell-usgs which version of pycsw? can you open a ticket on pycsw's issue tracker? Else the quick workaround is to simply run delete from records
directly in SQL.
@dnowacki-usgs, can you carry the ball here?
Thanks @tomkralidis! Direct SQL query works; I opened an issue over on the pycsw tracker.
@rsignell-usgs the wipe hadn't been successful for a long time; manually clearing and re-loading got rid of most of the entries with /
in them; now only usgs/data2/rsignell/data/ssh.nc
remains. I manually deleted that record and was able to get pycsw_export to run successfully. I'm not sure where this record is being harvested, but if we can find and remove it, we should be good with all the steps completing successfully (once we get the wipe step working reliably).
Closing this as things seem to be working smoothly using Postgres as the DB.
Issues in several of the steps:
pycsw_wipe
Gives
RuntimeError: ERROR: too many SQL variables
and never cleanly finishes.Proposed solution: Unclear; we need to either change
SQLITE_MAX_VARIABLE_NUMBER
runtime argument to sqlite or change the query so there are fewer variables.pycsw_load
Many of the records give the SQL error
ERROR: not inserted ERROR: UNIQUE constraint failed: records.identifier
:So something (maybe essential, maybe not) is not getting added to cite.db
Edit I think this is because pycsw_wipe is failing above and it's trying to re-write records which already exist.
Proposed solution: This isn't actually a problem with pycsw_load; we just need to fix pycsw_wipe.
pycsw_force
OK
pycsw_optimize
OK
pycsw_export
After successfully writing several XML files, dies with the following error:
I'm guessing this error is because it's trying to write a file in a path (
/export/estofs/atlantic/
) that does not exist (only/export
exists, not the subdirs). Either we need to rewrite the filename, maybe using underscores instead of slashes, or we need to create the directory first and then write the file.Proposed solution: Remove the records where
identifier
has/
in it. Currently, these are the records where that is the case:Other
I'm still not convinced the cron job is actually running properly, as
pycsw
is not a binary on the path specified in the crontab. The crontab as written is givingpycsw_wipe
etc. as arguments topycsw
when in actualitypycsw_wipe
and friends are binaries on the path (located in/usr/local/bin
).