Internal Server Error when retrieving all relations / Unable to retrieve relations for Model (JS SDK)

Dear Backendless-Team,

when I try to retrieve an object using Backendless.Persistance.of(Datamodel).findById(‘objectid’) without specifying any relations, I get the following error back from your server:

Request URL: https://api.backendless.com/v1/data/Brand/83D67DE3-BE4B-8D95-FF29-8E7BF6D0D700?loadRelations=*
Internal server error

If, however, I supply the correct relation, then it works. Note that the ‘*’ was inserted by your SDK.

This brings us to the next problem: There is no way to query for relations, as “describe” will not correctly tell me whether a field is a relation or not. Having defined the relation by hand in your interface, I will always get back “type: STRING” and “relatedTable: undefined”.

Request URL: https://api.backendless.com/v1/data/Brand/properties
[{"name":"objectId","required":false,"type":"STRING","defaultValue":null,"relatedTable":null},{"name":"Name","required":false,"type":"STRING","defaultValue":null,"relatedTable":null},{"name":"created","required":false,"type":"DATE","defaultValue":null,"relatedTable":null},{"name":"Setcards","required":false,"type":"STRING","defaultValue":null,"relatedTable":null},{"name":"updated","required":false,"type":"DATE","defaultValue":null,"relatedTable":null}]

(Setcards is actually a related field here.)

Any ideas?

Oh, actually it seems the internal server error is caused by a reference loop. I have 2 objects, A and B.
A references B as one-to-many, while B references A as one-to-one.
When requesting A with related B’s, it will fail with Error 500 - internal server error.
Removing the one-to-one relation allowed me to successfully query for the data, so only Problem #2 is bugging me now.

Thanks in advance for any ideas :slight_smile:

Hi Fabian,

Thank you for reporting this problem. We are looking into it.

Cheers,
Mark