question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception is not logged when pulling

See original GitHub issue

We are using spring-cloud-config 1.1.0.M3, and currently repeatedly see a warning being logged: Could not pull remote for master (current ref=Ref[refs/heads/master=386bfc56eb3b12de6e638db20180aedabcdef]), remote: git@bitbucket.org:company/config.git

However, since the Exception is not logged it makes it more difficult to find the actual cause of the problem.

Therefore I would like to propose the following change at JGitEnvironmentRepository, line 220:

catch (Exception e) {
    this.logger.warn("Could not pull remote for " + label + " (current ref=" + ref
            + "), remote: " + git.getRepository().getConfig().getString("remote",
            "origin", "url"));
}

change to:

               catch (Exception e) {
            this.logger.warn("Could not pull remote for " + label + " (current ref=" + ref
                    + "), remote: " + git.getRepository().getConfig().getString("remote",
                            "origin", "url"), e);
        }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
skhomecommented, Apr 21, 2016

I would like to see the error logging being improved as well.

We faced a similar problem which we were not able to track down to it’s root cause. We had an exception being thrown at the place mentioned above and suspected also an exception being thrown in MultipleJGitEnvironmentRepository#getLocations but the

catch (Exception e) {
    continue;
}

did hide the root cause.

While I totally agree that the config-server should be as resilient as possible and should rather serve requests from a local potentially stale cache then not at all, having more information available to fix the root cause would be helpful.

0reactions
tjuchniewiczcommented, Aug 30, 2016

I agree with @skhome. It would be great to log (even in DEBUG without stacktrace for me) error in MultipleJGitEnvironmentRepository#getLocations

catch (Exception e) {
    continue;
}

Now the only way for me to find root cause was debugging.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Log Exception Properly - Medium
Common Mistake 1: Not logging anything in `catch` statement · Common Mistake 2: Only log developer's message · Common Mistake 3: Log the...
Read more >
Why is the exception stack trace not logged in? [duplicate]
Just tried with log4j as the implementation, and I did get the stack trace. So does JDK logging does not enable to log...
Read more >
unhandled exceptions not logged on server #2924 - GitHub
I am experiencing following behavior: In development (local) there is no problem logging exceptions, all kind works. When I logged in remote ...
Read more >
Logging in .NET Core and ASP.NET Core | Microsoft Learn
Exception logging is provider-specific. Default log level. If the default log level is not set, the default log level value is Information ....
Read more >
Errors & Logging - Services - Winter CMS Documentation
If an exception handler returns a response, that response will be sent to the browser and no other error handlers will be called:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found