logzio-logback-appender icon indicating copy to clipboard operation
logzio-logback-appender copied to clipboard

IndexOutOfBoundsException: More context information

Open StephanPraetsch opened this issue 5 years ago • 5 comments

Hi

since 10th of october we have trouble with logzio-logback-appender.

		<dependency>
			<groupId>io.logz.logback</groupId>
			<artifactId>logzio-logback-appender</artifactId>
			<version>1.0.22</version>
		</dependency>

As we didn't change anything in configuration for months I suppose the problem is somewhere else. But I cannot suggest what because the error message is too meaningless: A IndexOutOfBoundsException. Where? Why? What could I change?

2019-10-21T09:47:09.084+0200 [main] ERROR org.springframework.boot.SpringApplication:771: Application startup failed
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in io.logz.logback.LogzioLogbackAppender[LOGZIO] - Uncaught error from Logz.io sender java.lang.IndexOutOfBoundsException
        at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:162)
        at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:208)
        at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:74)
        at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
        at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:115)
        at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
        at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
        at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
        at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
        at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
        at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
        at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)
        at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:175)
        at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98)
        at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
        at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
        at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
        at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
        at com.mercateo.*.*Application.main(*Application.java:10)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)

I'd like to have that exception more verbose.

This application runs with spring-boot 1.5.10.RELEASE and java 1.8.

StephanPraetsch avatar Oct 21 '19 09:10 StephanPraetsch

Additional Information: We fixed that problem by deleting /tmp/$APP_NAME$/logzio-buf/java/logzio-logback-appender/

StephanPraetsch avatar Oct 21 '19 13:10 StephanPraetsch

Maybe you accidentally used the same buffer directory concurrently by two processes? Or mixed somehow ?

On Mon, 21 Oct 2019 at 16:49 StephanPraetsch [email protected] wrote:

Additional Information: We fixed that problem by deleting /tmp/$APP_NAME$/logzio-buf/java/logzio-logback-appender/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/logzio/logzio-logback-appender/issues/63?email_source=notifications&email_token=AAHRR4O6PZRIOJB6EPTTUT3QPWXNTA5CNFSM4JC2PMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2MJIA#issuecomment-544523424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHRR4O5USQHX2OGJWQNYSLQPWXNTANCNFSM4JC2PMCQ .

asafm avatar Oct 21 '19 18:10 asafm

Maybe the app was started twice on the same host. But when I was testing it (try to start) there was no other instance of that app running on this host. Maybe two concurrent instances caused an inconsistent state in that buffer directory. But I expect a clean start to not be afflicted by an eldery, dead instance. Don't you?

StephanPraetsch avatar Oct 23 '19 10:10 StephanPraetsch

I imagine there is a problem when the application gets killed (kill -9) and afterwards it shall be restarted on the same host. The /tmp/$app/logzio-buf directory might be in inconsistent state. Either deleting / clearing that directory on startup or include a process-specific value like PID (that's mostly distict) or timestamp within /tmp/$app/logzio-buf/java/logzio-logback-appender

StephanPraetsch avatar Oct 24 '19 13:10 StephanPraetsch

Nothing changed until now for that matter. When running demos of Spring Cloud apps against logz.io I randomly get this exception. There is no /tmp/$app/logzio-buf/java/logzio-logback-appender, there is a /tmp/logzio-logback-queue/ that after clearing managed to remove the issue (at least for now).

It's a normal situation where I'm demoing a library and run e.g. 4 apps at the same time on my local machine. I had no knowledge that the logback logzio appender does not support such a situation?

marcingrzejszczak avatar Feb 23 '21 11:02 marcingrzejszczak

#91

tamir-michaeli avatar Jul 11 '23 14:07 tamir-michaeli

For Windows users, the path is under C:\Users\pramo\AppData\Local\Temp\logzio-logback-queue.Deleting the file resolved the issue. Sometimes this happens when you use the same profile for both local and other environments. In my case, I used the same dev profile for the local application to debug an issue in the dev environment.

sachinPramodya avatar Jul 10 '24 14:07 sachinPramodya