Closed abn closed 11 years ago
RockMongo does not seem to like the load with all the records. :(
Assigning to @ashcrow as RockMongo does not seem to load for me.
Could this be related to #32 ?
Imported data seems to use date "submittedon" value as a string. This might need to be converted to ISODate.
The date in question seems to match the initial seed data in the database.
Query:
{"submittedon": { $gte : ISODate("2012-12-21T01: 58: 40.472Z") }}
Result:
{
"_id": ObjectId("4fe1117cf80fe23d43c7f290"),
"_v1": {
"db_version": 8
},
"cves": [
"CVE-2011-2730"
],
"date": ISODate("2012-12-21T01:44:29.95Z"),
"db_version": 8,
"format": "Jar",
"hash": "1a2ee5525a4525e1df8b7e43e3b95992122ef478990acedb77a345929bc1ca435d614e12202a24fc9f9a038ee9d0a39e5a46b831c49857ca198cf4eafd7b515b",
"hashes": {
"sha1": {
"files": [
],
"combined": ""
},
"sha512": {
"files": [
],
"combined": "1a2ee5525a4525e1df8b7e43e3b95992122ef478990acedb77a345929bc1ca435d614e12202a24fc9f9a038ee9d0a39e5a46b831c49857ca198cf4eafd7b515b"
}
},
"meta": [
],
"name": "spring",
"status": "RELEASED",
"submittedon": ISODate("2012-12-21T01:58:40.472Z"),
"submitter": "ashcrow",
"vendor": "SpringSource",
"version": "2.5.6.SEC02"
}
@ashcrow Did some digging, could not find anything more that what I have mentioned above. From what I can see this bit of code should handle this condition in service_v2.init.py
item['date'] = item['date'].isoformat()
item['submittedon'] = item['submittedon'].isoformat()
Looks like its missing it for some reason. Leaving this one with your for the remainder.
On it. I have a feeling there is one or more submittedon or date fields which is not a date in the database.
Yeah rockmongo works, but way too slowly :-). I'll see if there is a way I can grant direct Mongo shell access soon.
I tried searching for records with submittedon or date of type string. No results showed up.
Besides since the error is thrown by json.dumps() - I wonder if the problem is the item was not correctly converted using isoformat()
Found it. It's from a temporary patch I put in yesterday removing one of the datetime to isoformat lines. Removing it shortly.
:+1: awesomeness.
Patch removed. Tested and it now works. It is slow though which I'll look into. Likely it just needs an index on the date field.
https://victims-websec.rhcloud.com/service/v2/update/2010-01-01T00:00:00/
Returns: