Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on unmarshalling JSON content for record #3210

Closed
AaronSchulz opened this issue Dec 16, 2014 · 6 comments
Closed

Error on unmarshalling JSON content for record #3210

AaronSchulz opened this issue Dec 16, 2014 · 6 comments
Assignees

Comments

@AaronSchulz
Copy link

In SNAPSHOT 2.0, I'm no longer able to insert a certain vertex. In the logs I see:

Caused by: com.orientechnologies.orient.core.exception.OSerializationException: Found invalid ] character at position 453 of text {"hash":"4253b5743cfd97037e15092839f2f82b5526b6c7","snaks":{"P854":[{"snaktype":"value", ...

A simplified failing command is shown below:

insert into v content {"P421":{"Q7525$5c0422b4-42bd-ac09-baa3-1cbaac840206":{"id":"Q7525$5c0422b4-42bd-ac09-baa3-1cbaac840206","mainsnak":{"snaktype":"value","property":"P421","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":6760},"type":"wikibase-entityid"}},"qualifiers":{"P580":[{"hash":"f0b9fbffaf50d976240c292faddb4d5dfedcf003","snaktype":"value","property":"P580","datatype":"time","datavalue":{"value":{"time":"+00000002014-10-26T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http://www.wikidata.org/entity/Q1985727"},"type":"time"}}]},"qualifiers-order":["P580"],"type":"statement","rank":"normal","references":[{"hash":"4253b5743cfd97037e15092839f2f82b5526b6c7","snaks":{"P854":[{"snaktype":"value","property":"P854","datatype":"url","datavalue":{"value":"http://pravo.gov.ru:8080/page.aspx?111660","type":"string"}}],"P357":[{"snaktype":"value","property":"P357","datatype":"string","datavalue":{"value":"\u0424\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043a\u043e\u043d \u043e\u0442 21.07.2014 \u2116 248-\u0424\u0417 "\u041e \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0424\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043a\u043e\u043d "\u041e\u0431 \u0438\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438"","type":"string"}}]},"snaks-order":["P854","P357"]}]},"Q7525$b6041eaf-45c0-133d-4ec8-57255dfc98c8":{"id":"Q7525$b6041eaf-45c0-133d-4ec8-57255dfc98c8","mainsnak":{"snaktype":"value","property":"P421","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":6779},"type":"wikibase-entityid"}},"qualifiers":{"P580":[{"hash":"8e986b15bfc002dc833b62e9d91bcba510f98563","snaktype":"value","property":"P580","datatype":"time","datavalue":{"value":{"time":"+00000002014-03-30T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http://www.wikidata.org/entity/Q1985727"},"type":"time"}}],"P582":[{"hash":"2bb8183637a1a8aa69aead3bec1095bc8a713cee","snaktype":"value","property":"P582","datatype":"time","datavalue":{"value":{"time":"+00000002014-10-26T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http://www.wikidata.org/entity/Q1985727"},"type":"time"}}]},"qualifiers-order":["P580","P582"],"type":"statement","rank":"normal","references":[{"hash":"dc37b2eeb13869390abf5d922077c4da7b41f0aa","snaks":{"P854":[{"snaktype":"value","property":"P854","datatype":"url","datavalue":{"value":"http://docs.sevsovet.com.ua/index.php?option=com_k2&view=item&id=2428:\u2116-14-7175-\u043e\u0431-\u0438\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438-\u0432\u0440\u0435\u043c\u0435\u043d\u0438-\u043d\u0430-\u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438-\u0433\u043e\u0440\u043e\u0434\u0430-\u0444\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f-\u0441\u0435\u0432\u0430\u0441\u0442\u043e\u043f\u043e\u043b\u044f","type":"string"}}],"P357":[{"snaktype":"value","property":"P357","datatype":"string","datavalue":{"value":"\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0417\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0421\u043e\u0431\u0440\u0430\u043d\u0438\u044f \u0433. \u0421\u0435\u0432\u0430\u0441\u0442\u043e\u043f\u043e\u043b\u044f \u043e\u0442 25 \u043c\u0430\u0440\u0442\u0430 2014 \u0433. N 14 (7175) "\u041e\u0431 \u0438\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0433\u043e\u0440\u043e\u0434\u0430 \u0444\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0421\u0435\u0432\u0430\u0441\u0442\u043e\u043f\u043e\u043b\u044f"","type":"string"}}]},"snaks-order":["P854","P357"]}]}}}

@luigidellaquila
Copy link
Member

I'm on it

@luigidellaquila
Copy link
Member

@AaronSchulz you say that you are no longer able to insert it, were you able to do it before?
Was the problem introduced after last fixes on json parsing?

@luigidellaquila
Copy link
Member

confirmed, it's a consequence of fix #3151, commit 14142cd.
I ratonalized it in a simple test case:

this succeeds

insert into v content 
{
    "foo":{
            "bar":{
                "P357":[
                            {

                                "datavalue":{
                                    "value":"\"\"",

                                }
                        }
                ]   
            },
            "three": "a"
        }
}

and this fails

insert into v content 
{
    "foo":{
            "bar":{
                "P357":[
                            {

                                "datavalue":{
                                    "value":"\"",

                                }
                        }
                ]   
            },
            "three": "a"
        }
}

The only difference is in the "datavalue" property, in the second case there is a single ".
It is a pattern: an even number of " in a string value result in correct execution, an odd number results in an error.

The strange thing is that also this is succeeding (odd number of ", but I removed the array as next field):

insert into v content 
{
    "foo":{
            "bar":{
                "P357":[
                            {

                                "datavalue":{
                                    "value":"\"",

                                }
                        }
                ]   
            }
        }
}

@lvca
Copy link
Member

lvca commented Dec 17, 2014

@luigidellaquila Can this be considered closed for 2.0-RC1 ?

@luigidellaquila
Copy link
Member

I'm working on it, but it's not trivial.
Consider at least one day for fix.

@luigidellaquila
Copy link
Member

closed and added a test case for this (so that fixing #3151 will not break this again)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants