JSON Feeds cannot resolve entity reference

7 posts / 0 new
Last post
JSON Feeds cannot resolve entity reference

Hello,

I'm experiencing a recurrent issue with the JSON feeds importer resolving entity references. In https://unicos.web.cern.ch I've created a content type to describe software components (UNICOS Component Page type) and a second one to define different software releases (UNICOS Component Release type). The component release type has a entity reference field to link a release to a software component.

I've also configured a JSON feeds imported to query the software releases and create the appropriate contents. Sometimes, the feeds importer is not able to resolve the reference to the software component and the log shows the following message:

2017-05-18 18:57:41 No existing entity found for entity 0 entityreference to source entity UNICOS CIET

As a result, the component release is not linked to the software component and the new releases are not displayed in the drupal pages. I have the same exact configuration running on https://jcop.web.cern.ch without any problems.

I would apreciate any help on the issue as I cannot access the the entityreference module files for trying to debug it.

Thank you in advance,
Ivan.

Hello Ivan,

Helo Ivan,

 

any recipe to reproduce the error? I tried on a clone to delete the imported content and re-import them but I can't see the error.

Also, you can put the entityreference module locally (uploading it using webdav), so you can debug it. Of course never do that on the production website.

According with the code, this error can be occur if the referenced entity cannot be find.

 

Cheers,

Eduardo

I've managed to reproduce the

I've managed to reproduce the error and with further investigation this is a problem when the import happens on automatically triggered Cron runs by the server boxes. If the import is triggered manually by user it works fine. The reason is a permissions problems, when the CRON run is triggered by server boxes it executes everything as Anonymous users. By checking the EntityReference feeds code, I've seen there is a permission check while trying to retrive the existing referenced items linked to the reference field.

On the working site jcop.web.cern.ch, anonnymous users have access to View the Component content type, but on Unicos website it's used the Access Control module and permissions are removed from anonymous user to view the Component Content type, see: https://unicos.web.cern.ch/admin/structure/types/manage/ares-component-p...

So under my point of view, if you let anonymous users to view the component pages, might resolve the issue (I will try to test it)

Cheers,

Eduardo

Thank you Eduardo, that makes

Thank you Eduardo, that makes sense. Unfortunately, the access to the component pages to view their description, documentation and downloads must be restricted for UNICOS..

Is there any possibility to execute the CRON jobs under a user name? Or any other solution that does not imply removing the visibility restriction?

Thanks,
Ivan.

Hi Ivan,

Hi Ivan,

 

sorry about the silence, I was not notified about your reply and didn't checked until today.

From upstream nothing to prevent that since this is by design, but certainly we can do something on the infra in order to run your site crons as a Drupal administrator user.

WIll take some time to be effective, but I will keep you updated once done.

Best regards,
Eduardo

Thank you Eduardo!

Thank you Eduardo!

Please let me know when there is a solution I can test.

Cheers,
Ivan.

Hi again Eduardo,

Hi again Eduardo,

Is this issue somehow scheduled? Should I create a service now request?
I have to monitor constantly the unicos web site to see if there are new releases, then remove them and trigger the import manually... it's annoying..

Thanks,
Ivan.

You are here