dspace.log is getting very big with continuous WARN and some ERROR messages

648 views
Skip to first unread message

Fatih Güneş

unread,
Sep 30, 2022, 3:15:42 PM9/30/22
to DSpace Technical Support
Hello everyone,
My dspace log is getting bigger and bigger with continuous (nearly 5 messages in every second) below messages. It is mostly WARN but ERROR line is seen sometimes as well.
Do you have any idea, why I get these messages and how can I deep further?

I am on Dspace 7.3.

ERROR d4b3c8d5-5f04-48e6-bd5a-e0c55fc97740 c10d26f3-2b24-4b38-a374-6c61048ee6cb org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ Unprocessable or invalid entity (status:422)
WARN  d4b3c8d5-5f04-48e6-bd5a-e0c55fc97740 9fde6cee-4004-44e3-a812-6dc46853f8e6 org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ Authentication is required (status:401 exception: Access is denied at: org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:73))

Alan Orth

unread,
Oct 3, 2022, 3:52:51 AM10/3/22
to Fatih Güneş, DSpace Technical Support
Hey Fatih,

I was curious so I checked GitHub for issues with this error and bingo!


So it looks like you're not alone...

Cheers,

--
All messages to this mailing list should adhere to the Code of Conduct: 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/fab6fc47-b21e-4ae4-ba4a-c005fa753aedn%40googlegroups.com.


--

Mike Schouten

unread,
Oct 4, 2022, 3:14:26 PM10/4/22
to DSpace Technical Support

Salutations!

I had noticed this issue as well and was going to ask about it.  I'm also getting these warning messages in dspace.log, resulting in very large log files.  In my case, our health check system is continuously pinging /home to make sure the site is still alive, and every time I get two warnings:

2022-10-03 17:30:37,918 WARN  fbebb20e-2cdd-49d4-8a6c-b2b421f2fca1 e5f2ba57-c08b-4858-aaa1-40824f726579 org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ Authentication is required (status:401 exception: Access is denied at: org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:73))
2022-10-03 17:30:37,918 WARN  fbebb20e-2cdd-49d4-8a6c-b2b421f2fca1 030126ca-c7df-443d-aa0e-934622c0db67 org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ Authentication is required (status:401 exception: Access is denied at: org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:73))

So, unlike the linked-to issue, even without trying to do anything like downloading files or editing items DSpace 7.3 is spitting out consistent warning messages about being unauthorized.  The website works fine though... I can navigate, view items, download and edit no problems.

My solution was going to be switching the logging level to ERROR when we go live... not ideal maybe, but serviceable.

Tim Donohue

unread,
Oct 4, 2022, 4:05:47 PM10/4/22
to Mike Schouten, DSpace Technical Support
All,

I can verify that currently, the DSpace REST API logs any​ non-successful request as minimally a WARN in the logs.  This is to allow you to more easily see/debug authentication failures and similar.

  • By default, any 4xx response code is logged as a WARN unless it's listed in the "logging.server.include-stacktrace-for-httpcode" configuration. Then it's logged as an ERROR instead of a WARN
  • By default, all 5xx response codes are always logged as ERROR. These tend to be a failure of the backend though.

Currently, this isn't directly configurable, but you could either switch to logging ERROR only, or you could modify the DSpaceApiExceptionControllerAdvice class where all response codes are logged.  See this method in that class: 


That said, if you feel this should be configurable in some manner, please submit a ticket with your suggestions & we'll see if we can find a way to improve this for future 7.x releases. https://github.com/DSpace/DSpace/issues

(The challenge here is that obviously detailed logs of 4xx and 5xx responses can be important to debug problems, but I can understand how some of these responses may be logged too frequently in production scenarios.)

Thanks,
Tim



From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of Mike Schouten <scho...@macewan.ca>
Sent: Tuesday, October 4, 2022 2:14 PM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: Re: [dspace-tech] dspace.log is getting very big with continuous WARN and some ERROR messages
 

Fatih Güneş

unread,
Oct 4, 2022, 4:29:50 PM10/4/22
to DSpace Technical Support
Hi all,
My case is similar to macewan's. Despite the bug Alan posted, we get the warning messages continuously without any trigger.
I dig the ids in a warning line. I come up with an unusual situation, which I suspect that it can create these auth errors.
When I open an item in simple view, the instance cannot show the breadcrumbs (see pic)
When I log in to the system as an admin user, the same item page shows the breadcrumbs (see pic2)
I checked the collections authorizations, and I see that there is no READ right for anonymous user (pic3). 
A standard collection has 3 rights (pic4), but the one I check has two.
I guess that somehow some collections Anonymous read rights deleted. A service which tries to access these items as an anonymous user may create these auth warnings.
I will try to find these absent rights and provide them. And then I will check if warn messages still continue or not.
breadcrumb-out.jpeg
collection_auths_problem.jpeg
collection_auths_std.jpeg
breadcrumb-in.jpeg
Reply all
Reply to author
Forward
0 new messages