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

Could not load logfile from actuator #741

Open
daring2 opened this issue Dec 4, 2023 · 0 comments
Open

Could not load logfile from actuator #741

daring2 opened this issue Dec 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@daring2
Copy link

daring2 commented Dec 4, 2023

Ostara cannot load logfile data from one of our application. The logfile tab shows the error:

Error loading data. Could not load logfile from actuator.

The application configured correctly, logfile endpoint works in browser. The application log contains the following errors related to Ostara requests:

Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]

As I understand the problem occurs because Ostara does not use "Accept" header for logfile requests. Our application sets "ContentNegotiationConfigurer#defaultContentType" parameter to MediaType.APPLICATION_JSON and this type is used if "Accept" header is missing.

Stacktrace:

org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
	at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:249)
	at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:183)
	at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:135)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
...

Expected Behavior

Logfile data is loaded correctly.

Current Behavior

The logfile tab shows the error "Could not load logfile from actuator".

Steps to Reproduce

  1. Create an application with ContentNegotiationConfigurer#defaultContentType parameter.
  2. Connect to the application and open logfile tab.

Possible Solution

Add "Accept" header for logfile requests.

Environment

  • Ostara version: 0.12.0
  • Spring boot version: 2.7.15
@daring2 daring2 added the bug Something isn't working label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant