Hi Tim,
SSR is the missing keyword - thank you! I was not aware of the fact that
it is enabled.
Is there a place (e.g. branch in Github) where we can see which frontend
configuration is taken into account to serve the public DSpace demo
instance? It would be helpful in the future to explain such differences.
Best
Sascha
Am 31.07.23 um 17:28 schrieb DSpace Technical Support:
> Hi Karol & Sascha,
>
> I previously misunderstood when you were seeing these 401 responses.
> Seeing them appear occasionally from the User Interface is *expected
> behavior*. What is going on is that the frontend is checking
> permissions of the current user to see if they are allowed to
> export/import in order to provide the proper links in the User Interface
> if they have access. If the user is allowed, this request returns a
> 200. If they are not allowed, it returns a 401. It is therefore *not*
> an error, but a permissions check... as a 401 response simply means you
> don't have permissions.
>
> Simply put, these are safe to ignore. You *will* sometimes see the User
> Interface "ask" the REST API if a user has permissions , or if a feature
> is enabled. The REST API then will sometimes respond with 401 or 404 or
> similar... this is expected behavior at this time. (It might be
> possible to reanalyze if there's a different way to achieve this... but
> this is how it works currently. You are welcome to log a bug ticket
> though in our ticketing system if you want:
>
https://github.com/DSpace/dspace-angular/issues)
>
> That said, if this is filling up your logs you could use caching to
> ensure the check happens less frequently.
>
> On the demo site, we have anonymous page caching turned on. This is why
> it's not visible there as frequently (it still may appear occasionally),
> as the pages are cached and this permission check happens /less
> frequently/. See this guide for how to enable that
> caching:
https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Configuration#UserInterfaceConfiguration-CacheSettings-ServerSideRendering(SSR)
>
> Hopefully that helps explain what is going on better. At a second
> glance, I think these are just permissions checks for current users.
> But, turning on caching should decrease their frequency.
>
> Tim
> On Saturday, July 29, 2023 at 7:05:20 AM UTC-5
karols...@gmail.com wrote:
>
> Hi Tim, Sascha,
>
> Tim, it looks like my first entry, is not correlated with the 401
> error - it's just a coincidence. I don't have any additional
> scripts, nor do I see any bots in the logs that are trying to access
> this content: /server/api/system/scripts/metadata-import
>
> Sascha, it directed me to conduct tests:
>
> 1) I blocked the firewall for everyone opened only for my computer
> and started opening the main page of my repository. And to my
> surprise, errors started to appear:
> *GET /server/api/system/scripts/metadata-import HTTP/1.1" 401 1514
> "-" "Mozilla/5.0 (Linux x64) node.js/12.22.12
> v8/7.8.279.23-node.57"* and
> *GET /server/api/system/scripts/metadata-export HTTP/1.1" 401 1514*
> *"-" "Mozilla/5.0 (Linux x64) node.js/12.22.12 v8/7.8.279.23-node.57"*
> even though I only opened the main repository page in the browser.
> Opening a collection, community, item view or anything else does not
> cause these errors.
>
> 2) I disabled the frontend (angular) left the backend enabled and
> the errors stopped appearing, which excludes bots that try to get
> into the
> /server/api/system/scripts/metadata-import
> /server/api/system/scripts/metadata-export
>
> Tim, in summary, I have exactly the same problem as Sascha,
> everytime when I opening, refreshing the main page it generating 2
> errors :
> **
> *GET /server/api/system/scripts/metadata-import HTTP/1.1" 401 1514
> *
> *GET /server/api/system/scripts/metadata-export HTTP/1.1" 401 1514*
> **
> --
> All messages to this mailing list should adhere to the Code of Conduct:
>
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> <
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx>
> ---
> You received this message because you are subscribed to the Google
> Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
dspace-tech...@googlegroups.com
> <mailto:
dspace-tech...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/dspace-tech/fe2f4e69-b707-429a-bf6d-051c77313270n%40googlegroups.com <
https://groups.google.com/d/msgid/dspace-tech/fe2f4e69-b707-429a-bf6d-051c77313270n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Sascha Szott
Abteilung Forschungsinformation und Publizieren
Universitätsbibliothek
Helmut-Schmidt-Universität
Universität der Bundeswehr Hamburg
Holstenhofweg 85
22043 Hamburg
📞
+49 171 6433825
🌍
https://ub.hsu-hh.de/