cancel
Showing results for 
Search instead for 
Did you mean: 

Getting "DocumentException: Unknown document type: content" while trying to get a content using GET REST API

Pranav_Pal
Champ in-the-making
Champ in-the-making

I am trying to get a content using REST APIs described here. But getting error "Failed to get document 7fc1cb55-0ce6-4a09-bbff-123cfb6cfb79".

In the logs I am getting this exception:

org.nuxeo.ecm.core.api.ClientException: Failed to get document 7fc1cb55-0ce6-4a09-bbff-123cfb6cfb79

Caused by: org.nuxeo.ecm.core.api.DocumentException: Unknown document type: content at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.newDocument(SQLSession.java:656)

The exact GET request I am making is http://localhost:8080/nuxeo/site/api/v1/id/7fc1cb55-0ce6-4a09-bbff-123cfb6cfb79

The content table does have a content with id "7fc1cb55-0ce6-4a09-bbff-123cfb6cfb79".

Any idea what is going wrong here? I am using Nuxeo 6.0 Community Edition.

1 ACCEPTED ANSWER

Florent_Guillau
World-Class Innovator
World-Class Innovator

The content table may have something with id 7fc1cb55-0ce6-4a09-bbff-123cfb6cfb79, but it's a complex property id, not a document id.

From a complex property to find the enclosing document you have to find the id in the hierarchy.id column, find the hierarchy.parentid on the same line, check that this second id is present in the hierarchy table with isproperty = false / 0, then you'll know you have a document id. If it's still a complex property you have to do the parentid stuff again.

See the structure of the VCS tables in VCS Tables.

View answer in original post

1 REPLY 1

Florent_Guillau
World-Class Innovator
World-Class Innovator

The content table may have something with id 7fc1cb55-0ce6-4a09-bbff-123cfb6cfb79, but it's a complex property id, not a document id.

From a complex property to find the enclosing document you have to find the id in the hierarchy.id column, find the hierarchy.parentid on the same line, check that this second id is present in the hierarchy table with isproperty = false / 0, then you'll know you have a document id. If it's still a complex property you have to do the parentid stuff again.

See the structure of the VCS tables in VCS Tables.