Giter VIP home page Giter VIP logo

Comments (17)

Jakob37 avatar Jakob37 commented on July 29, 2024 1

You can store cases and samples in MySQL if you want, but it's optional really. Yes, MongoDB is not used at all here so yes, it should be removed

OK I understand! OK I'll remove the dependency.

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024 1

I think this will fix it. Closing for now. Reopening if it comes back.

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024 1

It looks like this update fixed the error - the logs look clean now.

We still have the issue with Chanjo2 not running after every weekend though 🤔 But seems more and more likely that this is related to our setup rather than Chanjo2.

Anyway, I think this issue is resolved. I'll continue digging. If it still seems related to Chanjo2 internals, I'll be back with a separate issue.

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

Hi @Jakob37, we never saw this error but I guess it's because we don't use uvicorn as a runner, like you guys do. We don't have to have uvicorn handling the logging. I'll open a PR with a change

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024

Hi @Jakob37, we never saw this error but I guess it's because we don't use uvicorn as a runner, like you guys do. We don't have to have uvicorn handling the logging. I'll open a PR with a change

OK thanks!

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

What's the code you use to start the server? Are you logging to file?

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

Also, are you passing a log config file when you start the app?

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024

What's the code you use to start the server? Are you logging to file?

Here is the command we use to start Chanjo2:

command: ["uvicorn", "chanjo2.main:app", "--host=0.0.0.0", "--port=8000", "--workers=2", "--log-level=info", "--root-path=/chanjo2"]

Also, are you passing a log config file when you start the app?

Hmm, looks like not, not intentionally at least.

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

Hmm, looks like not, not intentionally at least.

We don't have a log config file either. It's weird, because if the app works fine with the command you mentioned I don't understand why you get that error over weekends. I'm not sure how to fix the logging since I don't understand what's really going on.
Looks like the app is restarted in the wrong way by some process because you get a call to lifespan. Chanjo2 is working with a MySQL database so it shouldn't be affected by the MongoDB backups. Please try to investigate a bit more what can be trying to restart chanjo2 on your side.

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024

Hmm, looks like not, not intentionally at least.

We don't have a log config file either. It's weird, because if the app works fine with the command you mentioned I don't understand why you get that error over weekends. I'm not sure how to fix the logging since I don't understand what's really going on. Looks like the app is restarted in the wrong way by some process because you get a call to lifespan. Chanjo2 is working with a MySQL database so it shouldn't be affected by the MongoDB backups. Please try to investigate a bit more what can be trying to restart chanjo2 on your side.

OK, I'll investigate a bit more!

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

OK, I'll investigate a bit more!

One thing that comes to my mind is that perhaps database and logging initiation should be present on a app startup function and not on a lifespan one (which gets executed also when the app stops or reboots)- I'll fix accordingly, and perhaps this will solve your issue

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024

Chanjo2 is working with a MySQL database so it shouldn't be affected by the MongoDB backups.

Hmm, aha. I had misunderstood here. I thought the SQL database was used only for intervals, but I see now that it also stores the cases and samples.

I currently have the mongodb container as a dependency for Chanjo2. Maybe that is part of what is happening here. I'll remove it.

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

You can store cases and samples in MySQL if you want, but it's optional really. Yes, MongoDB is not used at all here so yes, it should be removed

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024

Looks like it came back, without the mongodb dependency and with the updated version running the log statement from within the lifetime method.

I guess there are two parts here.

(1) Why is Chanjo2 restarting (must be something in our setup)
(2) Why does it crash on logging

I'll see if I can configure uvicorn somehow such that it doesn't crash on logging.

from chanjo2.

Jakob37 avatar Jakob37 commented on July 29, 2024

Question @northwestwitch , in the logger.py, specifically this part:

if LOG.handlers:
    LOG.handlers[0].setFormatter(console_formatter)
else:
    logging.basicConfig()

If the else-statement is hit for some reason, logging.basicConfig() is called. This does not seem to update the LOG instance, which later is used. Could this cause issues?

Anyway, I'll try to see if I can reproduce the error on my laptop. I think with a quicker cycle, I should be able to pinpoint the error.

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

Ok! I'll look into it

from chanjo2.

northwestwitch avatar northwestwitch commented on July 29, 2024

Anyway, I think this issue is resolved. I'll continue digging. If it still seems related to Chanjo2 internals, I'll be back with a separate issue.

Please do that! Thanks for reporting and sorry if we couldn't pinpoint the issue better

from chanjo2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.