[Dspace-tech] Monthly stats failing due to items with invalid metadata

0 views
Skip to first unread message

Alan Orth

unread,
Aug 25, 2015, 5:28:37 PM8/25/15
to DSpac...@lists.sourceforge.net
All,

(originally posted in an older thread, but I don't think anyone saw it!)...

I've noticed my stats scripts are failing due to
incorrect metadata. It appears some items have been
submitted with two dc.date.accessioned fields; one valid, and one
empty. An excerpt from when I tried to run the stats manually:

# su -c '/home/dspace/bin/dspace stat-monthly' tomcat55
Exception: ERROR: invalid input syntax for type timestamp: ""
org.postgresql.util.PSQLException: ERROR: invalid input syntax for
type timestamp: ""
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)

I've used the following query to find items with empty fields:

select item_id from metadatavalue where metadata_field_id=11 and text_value='';

... but I'm not sure how to delete those metadata fields from the
item? There are several hundred of these items, so it's not practical to get
their handles and do it manually...

Thanks,

Alan

--
Alan Orth
alan...@gmail.com
http://alaninkenya.org
http://mjanja.co.ke
"In heaven all the interesting people are missing." -Friedrich Nietzsche

Peter Dietz

unread,
Aug 25, 2015, 5:28:39 PM8/25/15
to Alan Orth, DSpac...@lists.sourceforge.net
Hi Alan,

## Backup your DB (for good measure).
pg_dump --create --oids --format=c --verbose --file=/opt/pgbackups/db-dspace-YYYY-MM-DD.backup dspace

## I'm sure you don't feel comfortable deleting things through SQL, especially since the application ought to be able to do this itself. But, it certainly is expedient.
DELETE from metadatavalue where metadata_field_id=11 and text_value='';



Peter Dietz



------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
DSpace-tech mailing list
DSpac...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Alan Orth

unread,
Aug 25, 2015, 5:28:45 PM8/25/15
to Peter Dietz, DSpac...@lists.sourceforge.net
Peter/list,

Great, that worked. After removing the empty metadata fields the
stats scripts choked on some other incorrectly-formatted ones (which I
promptly removed).

Now I've rerun the stats successfully, but December is missing from
the reports. I have 11/2011 and 1/2012, but no 12/2011. I've seen
the log files are there, but the reports for December never get
generated.

What am I missing?

Thanks,

Alan
Reply all
Reply to author
Forward
0 new messages