logzio / logzio-logback-appender

Logback Appender that ships logs using HTTPs bulk
Apache License 2.0
25 stars 19 forks source link

IndexOutOfBoundsException: More context information #63

Closed StephanPraetsch closed 1 year ago

StephanPraetsch commented 4 years ago

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 commented 4 years ago

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

asafm commented 4 years ago

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

On Mon, 21 Oct 2019 at 16:49 StephanPraetsch notifications@github.com 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 .

StephanPraetsch commented 4 years ago

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 commented 4 years ago

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

marcingrzejszczak commented 3 years ago

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?

tamir-michaeli commented 1 year ago

91

sachinPramodya commented 2 months ago

For Windows users, the path is underC:\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.