Your application is running, but something goes wrong? In this guide, you'll learn how to debug your application and solve your problem to make it running smoothly.
Before you begin, this page assumes the following:
- You have installed the Qovery CLI
- You have already deployed an application with Qovery
Debugging an application build
You have deployed your application with Qovery, and the status of your application is build error
. Meaning, your application has failed to build correctly.
There are two commands for getting a closer look at what's going on.
Qovery status
The command qovery status
give the status of our application. In the case of a build error, the reason is displayed into the console as well
$ qovery status
BRANCH NAME | STATUS | ENDPOINTS | APPLICATIONS | DATABASESmaster | build error | https://main-yenr7erjbs87dk4m-gtw.qovery.io | simple-example-node-with-postgresql | my-postgresql-3498225APPLICATION NAME | STATUS | DATABASESsimple-example-node-with-postgresql | build error | my-postgresql-3498225DATABASE NAME | STATUS | TYPE | VERSION | ENDPOINT | PORT | USERNAME | PASSWORD | APPLICATIONSmy-postgresql-3498225 | running | POSTGRESQL | 11.5 | <hidden> | <hidden> | <hidden> | <hidden> | simple-example-node-with-postgresqlSomething goes wrong:---------- Start of error message ----------Sending build context to Docker daemon 244.7kBStep 1/8 : FROM node:13-alpine---> bcfeabd22749Step 2/8 : RUN mkdir -p /usr/src/app---> Using cache---> 104f4613b141Step 3/8 : RUN toto---> Running in 52fa3e66f0c4/bin/sh: toto: not foundThe command '/bin/sh -c toto' returned a non-zero code: 127----------- End of error message -----------HINT: Ensure your Dockerfile is correct. Run and test your container locally with 'qovery run'
Here we can see that the build error comes from our Dockerfile. We also have a hint affirming this problem.
Qovery run
The command qovery run
is a wrapper around the commands docker build
and docker run
. It's the best way to test your container locally. Our motto is, if your application is running locally with qovery run
then it will work on Qovery.
In the case of a bad Dockerfile, by running qovery run
we directly see the error
$ qovery run
2020/04/22 10:12:37 reload master environment: DONEStep 1/8 : FROM node:13-alpine---> e1495e4ac50dStep 2/8 : RUN mkdir -p /usr/src/app---> Using cache---> 3afe9d6678e0Step 3/8 : RUN toto---> Running in fadf25b6fc5e/bin/sh: toto: not found
Debugging a running application
Your application is running, but for some reason, it is not working as expected. Here are a few tips to find out what's going on.
Qovery status
First, check that all your applications and services are up and running correctly with qovery status
$ qovery status
BRANCH NAME | STATUS | ENDPOINTS | APPLICATIONS | DATABASESmaster | running | https://main-yenr7erjbs87dk4m-gtw.qovery.io | simple-example-node-with-postgresql | my-postgresql-3498225APPLICATION NAME | STATUS | DATABASESsimple-example-node-with-postgresql | running | my-postgresql-3498225DATABASE NAME | STATUS | TYPE | VERSION | ENDPOINT | PORT | USERNAME | PASSWORD | APPLICATIONSmy-postgresql-3498225 | running | POSTGRESQL | 11.5 | <hidden> | <hidden> | <hidden> | <hidden> | simple-example-node-with-postgresql
Everything is fine here, meaning the problem is on our side as developer.
Qovery log
Your application is running, and logs are debug/info/warning/error messages can be thrown upon the standard output. To show them it's as easy as typing one command
$ qovery log
GET / 200 7.707 ms - 170GET / 200 5.572 ms - 170GET / 200 5.296 ms - 170GET /stylesheets/style.css 200 2.812 ms - 117GET /favicon.ico 404 8.127 ms - 913GET /stylesheets/style.css 304 0.861 ms - -GET / 304 5.100 ms - -GET /stylesheets/style.css 304 0.361 ms - -GET / 200 5.055 ms - 170
Pro tip: you can even follow the output with the -f
option
$ qovery log -f
If you want to display logs of all applications in a given environment, use qovery log --environment
instead:
$ qovery log --environmentlog-printer-gitlab | 2020-11-24T12:00:24.826Zlog-printer-gitlab-v2 | 2020-11-24T12:00:25.027Zlog-printer-gitlab | 2020-11-24T12:00:25.827Zlog-printer-gitlab-v2 | 2020-11-24T12:00:26.027Zlog-printer-gitlab | 2020-11-24T12:00:26.828Zlog-printer-gitlab-v2 | 2020-11-24T12:00:27.028Zlog-printer-gitlab | 2020-11-24T12:00:27.830Zlog-printer-gitlab-v2 | 2020-11-24T12:00:28.029Zlog-printer-gitlab | 2020-11-24T12:00:28.831Zlog-printer-gitlab-v2 | 2020-11-24T12:00:29.030Zlog-printer-gitlab | 2020-11-24T12:00:29.832Zlog-printer-gitlab-v2 | 2020-11-24T12:00:30.031Zlog-printer-gitlab | 2020-11-24T12:00:30.833Zlog-printer-gitlab-v2 | 2020-11-24T12:00:31.031Zlog-printer-gitlab | 2020-11-24T12:00:31.834Zlog-printer-gitlab-v2 | 2020-11-24T12:00:32.032Z
Rollback
You need more time to fix a bug? No worries, you can rollback at any time by using qovery deploy <commit id>
$ qovery deploy list
BRANCH | COMMIT DATE | COMMIT ID | COMMIT AUTHOR | DEPLOYEDmaster | 2020-04-22 10:34:11 +0200 +0200 | c4f5ab0396ab025a115f96c50c71e63ccf0aceae | Romaric Philogene | ✓master | 2020-04-22 09:55:25 +0200 +0200 | bafbc5501f016b6c906f373022ed3a40f4ecdf4b | Romaric Philogene |master | 2020-04-22 09:39:42 +0200 +0200 | 5fe83fed61b7c6933c015d73e2588d20ba9856d1 | Romaric Philogene |master | 2020-04-21 21:10:03 +0200 +0200 | f4b9bd4c8cc043e6a65e6a84db825d5897cbc30d | Romaric Philogene |master | 2020-04-21 20:59:24 +0200 +0200 | 8cf3e8aec44b2468e59eca59defe164eea10c63f | Romaric Philogene |master | 2020-04-20 22:20:04 +0200 +0200 | 5f9fd42f979f89bc20349cb89978bda139c3eca1 | Romaric Philogene |master | 2020-04-10 20:12:22 +0200 +0200 | efbbeecaacdb5acc5f3175bd83fa39536f0ed395 | Romaric Philogene |master | 2020-04-10 15:44:05 +0200 +0200 | ccfa5fad64dbb85d279c07f256101fd234e6624a | Romaric Philogene |master | 2020-04-10 15:26:57 +0200 +0200 | 27df877c83ca979f026f6eb4fbba73692293da87 | Romaric Philogene |master | 2020-04-08 20:03:29 +0200 +0200 | fa8aa4f12e80ae64b3ef8d217df1ecaccc576708 | Romaric Philogene |
To rollback on the commit 8cf3e8aec44b2468e59eca59defe164eea10c63f
it's as easy as executing the command
$ qovery deploy 8cf3e8aec44b2468e59eca59defe164eea10c63f
deployment in progress...Hint: type "qovery status --watch" to track the progression of this deployment
Then, we can watch the progress of the rollback with
$ qovery status --watch
100% |████████████████████████████████████████| [0s:0s]Your environment is ready!-- status output --BRANCH NAME | STATUS | ENDPOINTS | APPLICATIONS | DATABASESmaster | running | https://main-yenr7erjbs87dk4m-gtw.qovery.io | simple-example-node-with-postgresql | my-postgresql-3498225APPLICATION NAME | STATUS | DATABASESsimple-example-node-with-postgresql | running | my-postgresql-3498225DATABASE NAME | STATUS | TYPE | VERSION | ENDPOINT | PORT | USERNAME | PASSWORD | APPLICATIONSmy-postgresql-3498225 | running | POSTGRESQL | 11.5 | <hidden> | <hidden> | <hidden> | <hidden> | simple-example-node-with-postgresql
Well done! You have rollback to a previous working version.
Monitoring and alerting
Qovery will provide very soon monitoring and alerting. In the meantime, we highly recommend using tools like Datadog.
Third-party integration
Qovery integrates third-party services like Datadog, NewRelic, and others. You can use any third service that you want if they support containers (which is the case of most of them).
Do you need any help? Reach us on Discord