Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crapi-web Container "f6e54027f4ea" is unhealthy #156

Closed
mo718 opened this issue Nov 16, 2022 · 23 comments
Closed

crapi-web Container "f6e54027f4ea" is unhealthy #156

mo718 opened this issue Nov 16, 2022 · 23 comments
Labels
bug Something isn't working

Comments

@mo718
Copy link

mo718 commented Nov 16, 2022

Hello, I run crAPI in the Ubuntu18.04, but when I run the command "docker-compose -f docker-compose.yml --compatibility up -d", it report the error: "ERROR: for crapi-web Container "f6e54027f4ea" is unhealthy. "
the logs is:
Can't open /.keys/jwks.json for reading, No such file or directory
139965617173696:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/.keys/jwks.json','rb')
139965617173696:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:
Can't open /.keys/jwks.json for reading, No such file or directory
139712569619648:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/.keys/jwks.json','rb')
139712569619648:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:
Can't open /.keys/jwks.json for reading, No such file or directory
140523683042496:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/.keys/jwks.json','rb')
140523683042496:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:
Can't open /.keys/jwks.json for reading, No such file or directory
139945362683072:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/.keys/jwks.json','rb')
139945362683072:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:

@mo718 mo718 added the bug Something isn't working label Nov 16, 2022
@piyushroshan
Copy link
Collaborator

VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d
Seems like you are using compose file from develop and using main images.

@yyxxzz
Copy link

yyxxzz commented Nov 17, 2022

i meet the same question

@selectarget
Copy link

i meet the same question too

1 similar comment
@baicaiyihao
Copy link

i meet the same question too

@piyushroshan
Copy link
Collaborator

Can you do a
docker-compose -f docker-compose.yml pull
and then
docker-compose -f docker-compose.yml --compatibility up -d
Locally present images might be outdated.

@baicaiyihao
Copy link

I tried,but error

root@debian:~/crAPI#  docker-compose -f docker-compose.yml pull
Pulling postgresdb      ... done
Pulling mongodb         ... done
Pulling crapi-identity  ... done
Pulling crapi-community ... done
Pulling crapi-workshop  ... done
Pulling crapi-web       ... done
Pulling mailhog         ... done
root@debian:~/crAPI# docker-compose -f docker-compose.yml --compatibility up -d
Creating mailhog    ... done
Creating postgresdb ... done
Creating mongodb    ... done
Creating crapi-identity ... done

ERROR: for crapi-community  Container "8a9386e0f199" is unhealthy.
ERROR: Encountered errors while bringing up the project.

view logs

cat 8a9386e0f19940d6537e198abb5fd1a9c57412a4e5237d45a1d129a6ed689c9f-json.log 

{"log":"Can't open /.keys/jwks.json for reading, No such file or directory\n","stream":"stderr","time":"2022-11-18T06:38:08.278419904Z"}
{"log":"139625568449728:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/.keys/jwks.json','rb')\n","stream":"stderr","time":"2022-11-18T06:38:08.278454329Z"}
{"log":"139625568449728:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:\n","stream":"stderr","time":"2022-11-18T06:38:08.278458445Z"}

@nikhil-rajesh nikhil-rajesh mentioned this issue Nov 18, 2022
4 tasks
@piyushroshan
Copy link
Collaborator

piyushroshan commented Nov 18, 2022

The fix has been merged. Can you verify with
VERSION=develop docker-compose -f docker-compose.yml pull
and then
VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d
Locally present images might be outdated.

@TheCookieMonster0101
Copy link

The fix has been merged. Can you verify with VERSION=develop docker-compose -f docker-compose.yml pull and then VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d Locally present images might be outdated.

worked for me.

@nikhil-rajesh
Copy link
Collaborator

Please reopen if issue still persists.

@mo718
Copy link
Author

mo718 commented Nov 21, 2022

I tried,but error

root@zero-virtual-machine:/home/zero/Downloads# docker-compose -f docker-compose.yml --compatibility up -d
Creating network "downloads_default" with the default driver
Creating mongodb    ... done
Creating mailhog    ... done
Creating postgresdb ... done
Creating crapi-identity ... done
Creating crapi-community ... done
Creating crapi-workshop  ... done

ERROR: for crapi-web  Container "8f5c090d4259" is unhealthy.
ERROR: Encountered errors while bringing up the project.

view logs

Creating test database for alias 'default'...
Creating test database for alias 'mongodb'...
root         ERROR    /workshop/api/mechanic/signup - {'name': 'MechRaju', 'email': 'mechraju@crapi.com', 'mechanic_code': 'TRAC_MEC_3', 'number': '9123456708'} - 400 -{'password': [ErrorDetail(string='This field is required.', code='required')]}
django.request WARNING  Bad Request: /workshop/api/mechanic/signup
.django.request WARNING  Bad Request: /workshop/api/mechanic/signup
.django.request WARNING  Bad Request: /workshop/api/mechanic/signup
.django.request WARNING  Unauthorized: /workshop/api/mechanic/
django.request WARNING  Unauthorized: /workshop/api/mechanic/
.django.request WARNING  Unauthorized: /workshop/api/mechanic/
..root         ERROR    /workshop/api/merchant/contact_mechanic - {'mechanic_api': 'https://www.google.com', 'number_of_repeats': 5, 'mechanic_code': 'TRAC_MEC_3', 'vin': '9NFXO86WBWA082766', 'problem_details': 'My Car is not working'} - 400 -{'repeat_request_if_failed': [ErrorDetail(string='This field is required.', code='required')]}
django.request WARNING  Bad Request: /workshop/api/merchant/contact_mechanic
.root         INFO     Repeat count: 0
root         INFO     Repeat count: 1
root         INFO     Repeat count: 2
root         INFO     Repeat count: 3
root         INFO     Repeat count: 4
root         INFO     Repeat count: 5
django.request WARNING  Bad Request: /workshop/api/merchant/contact_mechanic
Fdjango.request ERROR    Service Unavailable: /workshop/api/merchant/contact_mechanic
..root         INFO     Repeat count: 0
root         INFO     Repeat count: 1
root         INFO     Repeat count: 2
root         INFO     Repeat count: 3
root         INFO     Repeat count: 4
root         INFO     Repeat count: 5
django.request WARNING  Not Found: /workshop/api/merchant/contact_mechanic
.django.request WARNING  Bad Request: /workshop/api/shop/apply_coupon
ProductTest  INFO     {'message': 'TRAC100 Coupon code is already claimed by you!! Please try with another coupon code'}
.root         ERROR    /workshop/api/shop/apply_coupon - {'coupon_code': 'TRAC105', 'amount': 75} - 400 -Coupon matching query does not exist.
django.request WARNING  Bad Request: /workshop/api/shop/apply_coupon
ProductTest  INFO     {'message': 'Coupon not found'}
.django.request WARNING  Bad Request: /workshop/api/shop/apply_coupon
ProductTest  INFO     {'message': '9123456708 Coupon code is already claimed by you!! Please try with another coupon code'}
.ProductTest  INFO     {'credit': 175.0, 'message': 'Coupon successfully applied!'}
.
======================================================================
FAIL: test_contact_mechanic (app.crapi.merchant.tests.MerchantTestCase)
gives all correct field for contact mechanic
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/app/crapi/merchant/tests.py", line 134, in test_contact_mechanic
    self.assertEqual(res.status_code, 200)
AssertionError: 400 != 200

----------------------------------------------------------------------
Ran 15 tests in 180.022s

FAILED (failures=1)
Destroying test database for alias 'default'...
Destroying test database for alias 'mongodb'...
This version of djongo does not support "NULL, NOT NULL column validation check" fully. Visit https://www.patreon.com/nesdis
This version of djongo does not support "schema validation using CONSTRAINT" fully. Visit https://www.patreon.com/nesdis
This version of djongo does not support "schema validation using KEY" fully. Visit https://www.patreon.com/nesdis
This version of djongo does not support "schema validation using REFERENCES" fully. Visit https://www.patreon.com/nesdis
This version of djongo does not support "COLUMN DROP NOT NULL " fully. Visit https://www.patreon.com/nesdis
This version of djongo does not support "DROP CASCADE" fully. Visit https://www.patreon.com/nesdis
System check identified no issues (0 silenced).

@baicaiyihao
Copy link

i meet the same question as mo718

@piyushroshan
Copy link
Collaborator

Have you pulled the latest images?
docker-compose -f docker-compose.yml pull

@baicaiyihao
Copy link

I use a new virtual machine

root@debian:~/crAPI#  docker-compose -f docker-compose.yml pull
Pulling postgresdb      ... done
Pulling mongodb         ... done
Pulling crapi-identity  ... done
Pulling crapi-community ... done
Pulling crapi-workshop  ... done
Pulling crapi-web       ... done
Pulling mailhog         ... done
root@debian:~/crAPI# docker-compose -f docker-compose.yml --compatibility up -d
Creating network "crapi_default" with the default driver
Creating volume "crapi_mongodb-data" with default driver
Creating volume "crapi_postgresql-data" with default driver
Creating postgresdb ... done
Creating mongodb    ... done
Creating mailhog    ... done
Creating crapi-identity ... done
Creating crapi-community ... done
Creating crapi-workshop  ... done

ERROR: for crapi-web  Container "738568d422ba" is unhealthy.
ERROR: Encountered errors while bringing up the project.
root@debian:~/crAPI# cat /var/lib/docker/containers/738568d422bacdba337a435f71d8ce0a20820a61d6c82d0a2dea8ad1fc41a948/738568d422bacdba337a435f71d8ce0a20820a61d6c82d0a2dea8ad1fc41a948-json.log 
{"log":"Creating test database for alias 'default'...\n","stream":"stderr","time":"2022-11-21T06:21:52.309322475Z"}
{"log":"Creating test database for alias 'mongodb'...\n","stream":"stderr","time":"2022-11-21T06:21:52.309354362Z"}
{"log":"root         ERROR    /workshop/api/mechanic/signup - {'name': 'MechRaju', 'email': 'mechraju@crapi.com', 'mechanic_code': 'TRAC_MEC_3', 'number': '9123456708'} - 400 -{'password': [ErrorDetail(string='This field is required.', code='required')]}\n","stream":"stderr","time":"2022-11-21T06:21:52.309357876Z"}
{"log":"django.request WARNING  Bad Request: /workshop/api/mechanic/signup\n","stream":"stderr","time":"2022-11-21T06:21:52.312446042Z"}
{"log":".django.request WARNING  Bad Request: /workshop/api/mechanic/signup\n","stream":"stderr","time":"2022-11-21T06:21:53.019614966Z"}
{"log":".django.request WARNING  Bad Request: /workshop/api/mechanic/signup\n","stream":"stderr","time":"2022-11-21T06:21:53.72662136Z"}
{"log":".django.request WARNING  Unauthorized: /workshop/api/mechanic/\n","stream":"stderr","time":"2022-11-21T06:21:53.729934315Z"}
{"log":"django.request WARNING  Unauthorized: /workshop/api/mechanic/\n","stream":"stderr","time":"2022-11-21T06:21:53.731806456Z"}
{"log":".django.request WARNING  Unauthorized: /workshop/api/mechanic/\n","stream":"stderr","time":"2022-11-21T06:21:54.509955185Z"}
{"log":"..root         ERROR    /workshop/api/merchant/contact_mechanic - {'mechanic_api': 'https://www.google.com', 'number_of_repeats': 5, 'mechanic_code': 'TRAC_MEC_3', 'vin': '9NFXO86WBWA082766', 'problem_details': 'My Car is not working'} - 400 -{'repeat_request_if_failed': [ErrorDetail(string='This field is required.', code='required')]}\n","stream":"stderr","time":"2022-11-21T06:21:57.340724982Z"}
{"log":"django.request WARNING  Bad Request: /workshop/api/merchant/contact_mechanic\n","stream":"stderr","time":"2022-11-21T06:21:57.341745321Z"}
{"log":".root         INFO     Repeat count: 0\n","stream":"stderr","time":"2022-11-21T06:21:58.815162271Z"}
{"log":"root         INFO     Repeat count: 1\n","stream":"stderr","time":"2022-11-21T06:24:08.071006299Z"}
{"log":"root         INFO     Repeat count: 2\n","stream":"stderr","time":"2022-11-21T06:26:19.143936828Z"}

@piyushroshan
Copy link
Collaborator

@baicaiyihao Sadly I have been unable to reproduce it. It could be a port conflict with another service. Could you dump logs from all the containers and provide them to us? Might help us narrow it down easily.

@baicaiyihao
Copy link

@piyushroshan yeah,I upload it to my repository. filename: containers.zip
https://github.com/baicaiyihao/crAPI_errorlogs

@Ctrlanton
Copy link

Step 1: run docker-compose stop

  • Stops running containers without removing them.

Step 2: run docker-compose down

  • Stops containers and removes containers, networks, volumes, and images created by up.

Step 3: run docker-compose -f docker-compose.yml --compatibility up -d

@AppSecExplained
Copy link

This issue is still persisting for me.

[~/labs/crAPI/deploy/docker] $ sudo docker-compose stop                                                       
Stopping crapi-community ... done
Stopping postgresdb      ... done
Stopping mongodb         ... done
Stopping mailhog         ... done
                                                                                                                                                                             
[~/labs/crAPI/deploy/docker] $ sudo docker-compose down                                                      
Removing crapi-community ... done
Removing crapi-identity  ... done
Removing postgresdb      ... done
Removing mongodb         ... done
Removing mailhog         ... done
Removing network docker_default
                                                                                                                                                                             
[~/labs/crAPI/deploy/docker] $ sudo VERSION=develop docker-compose -f docker-compose.yml pull                 
Pulling postgresdb      ... done
Pulling mongodb         ... done
Pulling crapi-identity  ... done
Pulling crapi-community ... done
Pulling crapi-workshop  ... done
Pulling crapi-web       ... done
Pulling mailhog         ... done
                                                                                                                                                                             
[~/labs/crAPI/deploy/docker] $ sudo VERSION=develop docker-compose -f docker-compose.yml --compatibility up -d
Creating network "docker_default" with the default driver
Creating mongodb    ... done
Creating postgresdb ... done
Creating mailhog    ... done
Creating crapi-identity ... done

ERROR: for crapi-community  Container "bd1d0a47515f" is unhealthy.
ERROR: Encountered errors while bringing up the project.

@vermapawel
Copy link

same for me as well

┌──(root㉿kali)-[~/…/crapi/crAPI/deploy/docker]
└─# docker-compose up
/usr/lib/python3/dist-packages/paramiko/transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,
mongodb is up-to-date
postgresdb is up-to-date
Recreating api.mypremiumdealership.com ... done
Recreating mailhog ... done
Recreating crapi-identity ... done

ERROR: for crapi-community Container "ae03dd34b5a6" is unhealthy.

ERROR: for crapi-workshop Container "ae03dd34b5a6" is unhealthy.
ERROR: Encountered errors while bringing up the project.

@p4d0rn
Copy link

p4d0rn commented Jul 10, 2023

This works for me.
Step1. comment the depends_on and healthcheck for crapi-web Container.
Step2. docker-compose -f docker-compose.yml --compatibility up -d
Step3. docker-compose restart

@Harshit-cyber-bit
Copy link

thanks @p4d0rn , that works

@GregorBiswanger
Copy link

Thanks @p4d0rn works for me too..

I hope the problem will be solved permanently.
Or is it just wrong to use git clone to pull the current project?

@elfizzy
Copy link

elfizzy commented Jul 28, 2023

docker-compose -f docker-compose.yml --compatibility up -d

worked for me too

@freeit-gyh
Copy link

refer to the link below:
https://medium.com/@fantomeofgames74/how-to-setup-crapi-in-ubuntu-server-and-make-it-network-accessible-5175bbf8ac8e
working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests