I’m using 2.12.0 on a Bitnami Linux VM.
I’m getting the “Unknown relationship: user_lookup_by_user_id” error when calling platform.api.get(‘system/user/’+platform.session.user.id+’?related=user_lookup_by_user_id’); from a system script.
Looking at the MySQL system database bitnami_dreamfactory, that table is missing completely.
I looked a few other similar questions in the forum. Clearing config and cache on the server did not work. I recently upgraded from 2.10, but I’ve never used the user_lookup_by_user_id table in the past so I don’t know how long this has been an issue.
How can I get this table into the database?
I’ve tried everything thing I can think of. I’ve re-installed DreamFactory a number of different ways with the same result each time. I’m now using a fresh Ubuntu 16.04 VM with a fresh DreamFactory 2.12.0 installation. When I run a system/user request from API Docs with a related field of “user_lookup_by_user_id” I get the screenshot and log responses below:
[2018-06-12 18:45:41] local.INFO: [REQUEST] {"API Version":"2.0","Method":"GET","Service":"system","Resource":"user/5","Requestor":1}
[2018-06-12 18:45:41] local.DEBUG: [REQUEST] {"Parameters":"{\"related\":\"user_lookup_by_user_id\"}","API Key":"...removed...$
[2018-06-12 18:45:41] local.DEBUG: API event handled: system.user.get.pre_process
[2018-06-12 18:45:41] local.DEBUG: API event handled: system.user.get.post_process
[2018-06-12 18:45:41] local.DEBUG: Service event handled: system.user.get
[2018-06-12 18:45:41] local.INFO: [RESPONSE] {"Status Code":400,"Content-Type":null}
[2018-06-12 18:45:41] local.INFO: [RESPONSE] {"Status Code":400,"Content-Type":"application/json"}
@erikkurtu
When you are making this call can you please send us a shot of the endpoint you are trying to hit? Is it this one, with user_lookup_by_user_id? Can you share how in this new instance you are trying to get there? I understand in the previous one it looks like you were trying to hit it via a script?
Thanks,
Erik
Yes, it is that endpoint - /api/v2/api_docs/system/user/{id}
Right now I’m calling the API directly from API Docs.
Thanks!
Hey @erikkurtu
Thanks for the screenshot. You are getting a 400 as that is not a valid table/endpoint in the schema of the local DB.
In my local system, I am using MySQL as my instance DB which stores my user info, apps, files, etc.
When I call the user with id 2, I get this:
When I look at MySQL Workbench, i see the same info:
Both of these ways produce the result of getting me all of the information regarding the user with that particular ID.
Yes, I get that same response without the related table. What I am trying to do is get the user’s lookup keys/values with the request, as described here:
https://wiki.dreamfactory.com/DreamFactory/Tutorials/Managing_user_lookups
But when I add the related table user_lookup_by_user_id, I get the error and no lookup information.
Is there a different / correct method for getting user lookups via the api?
I think we have a solution. Once it is confirmed I will update here, but in the mean time if you wouldn’t mind checking your email and giving the solution a shot, that would be great.