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

(bug): "INVALID_OBJECT_ID" - Not able to embed analytics #507

Open
prajwal-unext opened this issue Jun 20, 2022 · 3 comments
Open

(bug): "INVALID_OBJECT_ID" - Not able to embed analytics #507

prajwal-unext opened this issue Jun 20, 2022 · 3 comments

Comments

@prajwal-unext
Copy link

prajwal-unext commented Jun 20, 2022

Error

{
    "code": "INVALID_OBJECT_ID",
    "args": {
        "ID": "0"
    }
}
"Error: Invalid object id [0]
    at UserRoleGetAction.parseServerResponse (http://localhost:4200/vendor.js:25858:23)
    at UserRoleGetAction.handleResponse (http://localhost:4200/vendor.js:25905:35)
    at KalturaMultiRequest.handleResponse (http://localhost:4200/vendor.js:25640:52)
    at MapSubscriber.project (http://localhost:4200/vendor.js:26299:26)
    at MapSubscriber._next (http://localhost:4200/vendor.js:338295:31)
    at MapSubscriber.next (http://localhost:4200/vendor.js:187566:14)
    at CatchSubscriber._next (http://localhost:4200/vendor.js:187601:24)
    at CatchSubscriber.next (http://localhost:4200/vendor.js:187566:14)
    at MapSubscriber._next (http://localhost:4200/vendor.js:338301:24)
    at MapSubscriber.next (http://localhost:4200/vendor.js:187566:14)"

Possible Sollution:
userRoleId is hard coded as 0 which could be causing the issue.

const getRoleAction = new UserRoleGetAction({ userRoleId: 0 }).setDependency(['userRoleId', 0, 'roleIds']);

Steps to reproduce:

  1. Update ks and pid config in src/dev/analyticsLoader.html
  2. npm run example
  3. open http://localhost:4201

Please let me know how to solve this issue, or if there is a possible fix that would be released soon.

Thanks.

@kaltura-hooks
Copy link

Hi @prajwal-unext,

Thank for you reporting an issue and helping improve Kaltura!

To get the fastest response time, and help the maintainers review and test your reported issues or suggestions, please ensure that your issue includes the following (please comment with more info if you have not included all this info in your original issue):

  • Is the issue you're experiencing consistent and across platforms? or does it only happens on certain conditions?
    please provide as much details as possible.
  • Which Kaltura deployment you're using: Kaltura SaaS, or self-hosted?
    If self hosted, are you using the RPM or deb install?
  • Packages installed.
    When using RPM, paste the output for:
	# rpm -qa \"kaltura*\"
For deb based systems:
	# dpkg -l \"kaltura-*\"
  • If running a self hosted ENV - provide the MySQL server version used
  • If running a self hosted ENV - is this a single all in 1 server or a cluster?
  • If running a self hosted ENV, while making the problematic request, run:
	# tail -f /opt/kaltura/log/*.log /opt/kaltura/log/batch/*.log | grep -A 1 -B 1 --color \"ERR:\|PHP\|trace\|CRIT\|\[error\]\"

and paste the output.

  • When relevant, provide any screenshots or screen recordings showing the issue you're experiencing.

For general troubleshooting see:
https://github.com/kaltura/platform-install-packages/blob/Jupiter-10.13.0/doc/kaltura-packages-faq.md#troubleshooting-help

If you only have a general question rather than a bug report, please close this issue and post at:
http://forum.kaltura.org

Thank you in advance,

@prajwal-unext
Copy link
Author

Is the issue you're experiencing consistent and across platforms? or does it only happens on certain conditions?
please provide as much details as possible.

experiencing consistent and across platforms. The issue seems to be from an Kaltura API exception.

Screenshot 2022-06-20 at 7 25 58 PM

Screenshot 2022-06-20 at 7 26 38 PM

Screenshot 2022-06-20 at 7 27 04 PM

Here is the request that fails.

curl 'http://www.kaltura.com/api_v3/service/multirequest?format=1&clientTag=kmc-analytics%3A3.0.1' \
  -H 'Accept: application/json' \
  -H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Origin: http://localhost:4200' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://localhost:4200/' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' \
  --data-raw '{"0":{"ks":"djJ8MzMwMzk5M3x_f1_tbm3KgmN1IPZ4hC99C2N7aTWW-eTtfsNKnPRbkEEljhTmzI88sn2X-wJ3Oi2wh0aKwN-zETADD17pOCkxXYwJFBqHIeqGngoeYQHbQQIkfDhFhBSbuesrrtrsGG6mosN3YZXpfvUzoIZz_wzD","responseProfile":{"objectType":"KalturaDetachedResponseProfile","type":1,"fields":"roleIds"},"service":"user","action":"get"},"1":{"ks":"djJ8MzMwMzk5M3x_f1_tbm3KgmN1IPZ4hC99C2N7aTWW-eTtfsNKnPRbkEEljhTmzI88sn2X-wJ3Oi2wh0aKwN-zETADD17pOCkxXYwJFBqHIeqGngoeYQHbQQIkfDhFhBSbuesrrtrsGG6mosN3YZXpfvUzoIZz_wzD","service":"userrole","action":"get","userRoleId":"{1:result:roleIds}"},"2":{"ks":"djJ8MzMwMzk5M3x_f1_tbm3KgmN1IPZ4hC99C2N7aTWW-eTtfsNKnPRbkEEljhTmzI88sn2X-wJ3Oi2wh0aKwN-zETADD17pOCkxXYwJFBqHIeqGngoeYQHbQQIkfDhFhBSbuesrrtrsGG6mosN3YZXpfvUzoIZz_wzD","responseProfile":{"objectType":"KalturaDetachedResponseProfile","type":1,"fields":"name"},"service":"permission","action":"list","filter":{"objectType":"KalturaPermissionFilter","typeIn":"2,3","statusEqual":1},"pager":{"objectType":"KalturaFilterPager","pageSize":500}},"3":{"ks":"djJ8MzMwMzk5M3x_f1_tbm3KgmN1IPZ4hC99C2N7aTWW-eTtfsNKnPRbkEEljhTmzI88sn2X-wJ3Oi2wh0aKwN-zETADD17pOCkxXYwJFBqHIeqGngoeYQHbQQIkfDhFhBSbuesrrtrsGG6mosN3YZXpfvUzoIZz_wzD","service":"permission","action":"getCurrentPermissions"},"4":{"ks":"djJ8MzMwMzk5M3x_f1_tbm3KgmN1IPZ4hC99C2N7aTWW-eTtfsNKnPRbkEEljhTmzI88sn2X-wJ3Oi2wh0aKwN-zETADD17pOCkxXYwJFBqHIeqGngoeYQHbQQIkfDhFhBSbuesrrtrsGG6mosN3YZXpfvUzoIZz_wzD","responseProfile":{"objectType":"KalturaDetachedResponseProfile","type":1,"fields":"createdAt"},"service":"partner","action":"get","id":3303993},"5":{"ks":"djJ8MzMwMzk5M3x_f1_tbm3KgmN1IPZ4hC99C2N7aTWW-eTtfsNKnPRbkEEljhTmzI88sn2X-wJ3Oi2wh0aKwN-zETADD17pOCkxXYwJFBqHIeqGngoeYQHbQQIkfDhFhBSbuesrrtrsGG6mosN3YZXpfvUzoIZz_wzD","service":"uiconf","action":"listTemplates","filter":{"objectType":"KalturaUiConfFilter","partnerIdEqual":0,"tagsMultiLikeOr":"AnalyticsV7_v3.0.1","tagsMultiLikeAnd":"autodeploy"}},"apiVersion":"18.3.0"}' \
  --compressed \
  --insecure

Which Kaltura deployment you're using: Kaltura SaaS, or self-hosted?

Kaltura SaaS

Packages installed.

Facing the issue in this very repo.

@prajwal-unext
Copy link
Author

Updates on this Issue

Noticed that when we create the Kaltura session with the userId attribute set to a user from KMC whose role is Publisher Administrator we are able to embed the analytics.

  1. Can you confirm if this embed only works with Publisher Administrator role ?

We are working on an application that allows non-learners to create videos and all users can consume these videos.
Non learners are allowed to view the analytics for these videos.

  1. When we create a KS token during login, we noticed that a user will be created in the KAF admin portal. We set the role attribute to adminRole for a non-learner login (this is being set in the privileges attribute during session creation). Ideally shouldn't an admin role also be allowed to view the analytics of all the videos created ?

Can you please respond on the above questions.

Let me know incase you have any queries regarding the above.

Thanks

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

2 participants