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

Error appears in DevTools Console ("doesn't contain the link profiles") when Researcher Profiles disabled #3759

Open
tdonohue opened this issue Dec 18, 2024 · 4 comments · May be fixed by #3948
Assignees
Labels
affects: main Issue impacts "main" (latest release). affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug component: user profile error handling How errors are handled from REST API help wanted Needs a volunteer to claim to move forward high priority

Comments

@tdonohue
Copy link
Member

Describe the bug

This error appears to have started after the 8.0 release. But, it's reproducible on both our main and dspace-8_x branches. If you open your browser's DevTools and login, you'll see an error like this in the Console:

main.34ada579bae23bc2.js:1 ERROR Error: {"actuator":{"href":"http://localhost:8080/server/actuator"},"authn":{"href":"http://localhost:8080/server/api/authn"},"authorizations":{"href":"http://localhost:8080/server/api/authz/authorizations"},"bitstreamformats":{"href":"http://localhost:8080/server/api/core/bitstreamformats"},"bitstreams":{"href":"http://localhost:8080/server/api/core/bitstreams"},"browses":{"href":"http://localhost:8080/server/api/discover/browses"},"bulkaccessconditionoptions":{"href":"http://localhost:8080/server/api/config/bulkaccessconditionoptions"},"bundles":{"href":"http://localhost:8080/server/api/core/bundles"},"claimedtasks":{"href":"http://localhost:8080/server/api/workflow/claimedtasks"},"claimedtasks-search":{"href":"http://localhost:8080/server/api/workflow/claimedtasks/search"},"collections":{"href":"http://localhost:8080/server/api/core/collections"},"communities":{"href":"http://localhost:8080/server/api/core/communities"},"contentreport":{"href":"http://localhost:8080/server/api/contentreport"},"correctiontypes":{"href":"http://localhost:8080/server/api/config/correctiontypes"},"discover":{"href":"http://localhost:8080/server/api/discover"},"dso":{"href":"http://localhost:8080/server/api/dso/find{?uuid}","templated":true},"duplicates":{"href":"http://localhost:8080/server/api/submission/duplicates"},"duplicates-search":{"href":"http://localhost:8080/server/api/submission/duplicates/search"},"enqueueretry":{"href":"http://localhost:8080/server/api/ldn/messages/{id}/enqueueretry","templated":true},"entitytypes":{"href":"http://localhost:8080/server/api/core/entitytypes"},"eperson-registration":{"href":"http://localhost:8080/server/api/eperson/registrations"},"epersons":{"href":"http://localhost:8080/server/api/eperson/epersons"},"externalsources":{"href":"http://localhost:8080/server/api/integration/externalsources"},"features":{"href":"http://localhost:8080/server/api/authz/features"},"feedbacks":{"href":"http://localhost:8080/server/api/tools/feedbacks"},"groups":{"href":"http://localhost:8080/server/api/eperson/groups"},"identifiers":{"href":"http://localhost:8080/server/api/pid/identifiers"},"itemfilters":{"href":"http://localhost:8080/server/api/config/itemfilters"},"itemrequests":{"href":"http://localhost:8080/server/api/tools/itemrequests"},"items":{"href":"http://localhost:8080/server/api/core/items"},"itemtemplates":{"href":"http://localhost:8080/server/api/core/itemtemplates"},"ldnservices":{"href":"http://localhost:8080/server/api/ldn/ldnservices"},"messages":{"href":"http://localhost:8080/server/api/ldn/messages"},"metadatafields":{"href":"http://localhost:8080/server/api/core/metadatafields"},"metadataschemas":{"href":"http://localhost:8080/server/api/core/metadataschemas"},"notifyrequests":{"href":"http://localhost:8080/server/api/ldn/notifyrequests"},"oidc":{"href":"http://localhost:8080/server/api/authn"},"orcidhistories":{"href":"http://localhost:8080/server/api/eperson/orcidhistories"},"orcidqueues":{"href":"http://localhost:8080/server/api/eperson/orcidqueues"},"pid":{"href":"http://localhost:8080/server/api/pid/find{?id}","templated":true},"pooltasks":{"href":"http://localhost:8080/server/api/workflow/pooltasks"},"pooltasks-search":{"href":"http://localhost:8080/server/api/workflow/pooltasks/search"},"processes":{"href":"http://localhost:8080/server/api/system/processes"},"properties":{"href":"http://localhost:8080/server/api/config/properties"},"qualityassuranceevents":{"href":"http://localhost:8080/server/api/integration/qualityassuranceevents"},"qualityassurancesources":{"href":"http://localhost:8080/server/api/integration/qualityassurancesources"},"qualityassurancetopics":{"href":"http://localhost:8080/server/api/integration/qualityassurancetopics"},"registrations":{"href":"http://localhost:8080/server/api/eperson/registrations"},"relationships":{"href":"http://localhost:8080/server/api/core/relationships"},"relationshiptypes":{"href":"http://localhost:8080/server/api/core/relationshiptypes"},"resourcepolicies":{"href":"http://localhost:8080/server/api/authz/resourcepolicies"},"resourcepolicies-search":{"href":"http://localhost:8080/server/api/authz/resourcepolicies/search"},"scripts":{"href":"http://localhost:8080/server/api/system/scripts"},"self":{"href":"http://localhost:8080/server/api"},"sites":{"href":"http://localhost:8080/server/api/core/sites"},"statistics":{"href":"http://localhost:8080/server/api/statistics"},"submissionaccessoptions":{"href":"http://localhost:8080/server/api/config/submissionaccessoptions"},"submissioncclicenseUrls":{"href":"http://localhost:8080/server/api/config/submissioncclicenseUrls"},"submissioncclicenseUrls-search":{"href":"http://localhost:8080/server/api/config/submissioncclicenseUrls/search"},"submissioncclicenses":{"href":"http://localhost:8080/server/api/config/submissioncclicenses"},"submissioncoarnotifyconfigs":{"href":"http://localhost:8080/server/api/config/submissioncoarnotifyconfigs"},"submissiondefinitions":{"href":"http://localhost:8080/server/api/config/submissiondefinitions"},"submissionforms":{"href":"http://localhost:8080/server/api/config/submissionforms"},"submissionsections":{"href":"http://localhost:8080/server/api/config/submissionsections"},"submissionuploads":{"href":"http://localhost:8080/server/api/config/submissionuploads"},"subscriptions":{"href":"http://localhost:8080/server/api/core/subscriptions"},"subscriptions-search":{"href":"http://localhost:8080/server/api/core/subscriptions/search"},"suggestions":{"href":"http://localhost:8080/server/api/integration/suggestions"},"suggestionsources":{"href":"http://localhost:8080/server/api/integration/suggestionsources"},"suggestiontargets":{"href":"http://localhost:8080/server/api/integration/suggestiontargets"},"supervisionorders":{"href":"http://localhost:8080/server/api/core/supervisionorders"},"systemwidealerts":{"href":"http://localhost:8080/server/api/system/systemwidealerts"},"usagereports":{"href":"http://localhost:8080/server/api/statistics/usagereports"},"versionhistories":{"href":"http://localhost:8080/server/api/versioning/versionhistories"},"versions":{"href":"http://localhost:8080/server/api/versioning/versions"},"vocabularies":{"href":"http://localhost:8080/server/api/submission/vocabularies"},"vocabularyEntryDetails":{"href":"http://localhost:8080/server/api/submission/vocabularyEntryDetails"},"vocabularyEntryDetails-search":{"href":"http://localhost:8080/server/api/submission/vocabularyEntryDetails/search"},"workflowactions":{"href":"http://localhost:8080/server/api/config/workflowactions"},"workflowdefinitions":{"href":"http://localhost:8080/server/api/config/workflowdefinitions"},"workflowitems":{"href":"http://localhost:8080/server/api/workflow/workflowitems"},"workflowsteps":{"href":"http://localhost:8080/server/api/config/workflowsteps"},"workspaceitems":{"href":"http://localhost:8080/server/api/submission/workspaceitems"}} doesn't contain the link profiles
    at main.34ada579bae23bc2.js:1:279204
    at main.34ada579bae23bc2.js:1:1897441
    at c._next (main.34ada579bae23bc2.js:1:1893835)
    at c.next (main.34ada579bae23bc2.js:1:1882666)
    at main.34ada579bae23bc2.js:1:1897434
    at c._next (main.34ada579bae23bc2.js:1:1893835)
    at c.next (main.34ada579bae23bc2.js:1:1882666)
    at main.34ada579bae23bc2.js:1:1901895
    at c._next (main.34ada579bae23bc2.js:1:1893835)
    at c.next (main.34ada579bae23bc2.js:1:1882666)

Even though this error states that a profiles "link" is missing from a REST API response, it seems like a possible dspace-angular bug with attempting to access the Researcher Profiles when that feature is disabled. (The profiles link relates to Researcher Profiles: https://github.com/DSpace/RestContract/blob/main/profiles.md)

To Reproduce

Steps to reproduce the behavior:

  1. Ensure Researcher Profiles feature is disabled on the backend. Ensure this setting is commented out in your researcher-profile.cfg or local.cfg: researcher-profile.entity-type = Person
  2. Run the UI in production mode.
    • For main, use npm run build:prod; npm run serve:ssr. For dspace-8_x, use yarn run build:prod; yarn run serve:ssr
  3. Open up Chrome Dev Tools
  4. Visit the homepage. No errors in Chrome Dev Tools
  5. Now, login as any user, and you'll see the above error appear in the "Console" of Dev Tools.

Expected behavior

No error should appear in Dev Tools.

@tdonohue tdonohue added bug help wanted Needs a volunteer to claim to move forward high priority component: user profile error handling How errors are handled from REST API affects: main Issue impacts "main" (latest release). affects: 8.x Issue impacts 8.x releases affects: 7.x Issue impacts 7.x releases labels Dec 18, 2024
@kshepherd
Copy link
Member

kshepherd commented Jan 29, 2025

Something is trying to resolve the endpoint link prematurely, for sure. I have not figured it out yet though I do get a stack trace that looks promising, I don't see changes to these particular lines / calls (other than the mentioned PR in base data service) after 8.0. It appears related to the suggestions service? But I haven't been able to see an obvious change yet

Image

The closest changes were in June 2024 just before 8.0 - @tdonohue are we sure this appeared only after 8.0? Is it possible that demo, other test instances actually have it configured and so do not see the error?

@tdonohue
Copy link
Member Author

@kshepherd : I can verify that demo/sandbox do not see this error because they have Researcher Profiles enabled.

I admit, I don't know exactly when this error began. It's possible that it started before 8.0...but I didn't notice it myself until much after the 8.0 release.

@tdonohue
Copy link
Member Author

tdonohue commented Jan 31, 2025

@kshepherd : I looked a bit closer at this today. I'm still not sure of the cause, but from the stacktrace you shared, it's odd to me that the Suggestions code is even triggering. The code in the stacktrace you shared should only execute if Researcher Profiles are enabled.

So, I feel like the error must be somewhere further up the stack (i.e. not even visible in that stacktrace). It's almost like we are missing a check for "are Researcher Profiles enabled?" somewhere higher up that stack.

I know that still doesn't get us much closer. But, I'm just trying to say that I think the problem starts when the Suggestions code is unnecessarily initialized / called. That Suggestions feature should not even be called when Researcher Profiles are disabled.

@toniprieto
Copy link
Contributor

toniprieto commented Feb 3, 2025

I think this happens in the effects defined here: https://github.com/DSpace/dspace-angular/blob/main/src/app/notifications/suggestion-targets/suggestion-targets.effects.ts#L74-L113

I’ve created a PR that checks the API configuration key to see if Researcher profiles are enabled, preventing the call if they are not.

I don’t know much about the suggestions feature, so if there’s a better solution, feel free to discard this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: main Issue impacts "main" (latest release). affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug component: user profile error handling How errors are handled from REST API help wanted Needs a volunteer to claim to move forward high priority
Projects
Development

Successfully merging a pull request may close this issue.

4 participants