OmkarPathak / ResumeParser

A simple resume parser used for extracting information from resumes
MIT License
285 stars 164 forks source link

ValueError: Table django_admin_log does not exist #10

Closed goyalnikhil02 closed 5 years ago

goyalnikhil02 commented 5 years ago

while using the docker-compose up -d build .I find this error

ERROR: No such service: build

So i use the below command:But still i am facing issue. Please help

user:/home/user/Downloads/ResumeParser-master/resume_parser# docker build . Sending build context to Docker daemon 393.7kB .......

[nltk_data] Downloading package maxent_ne_chunker to [nltk_data] /root/nltk_data... [nltk_data] Unzipping chunkers/maxent_ne_chunker.zip. [nltk_data] Downloading package words to /root/nltk_data... [nltk_data] Unzipping corpora/words.zip. [nltk_data] Downloading package stopwords to /root/nltk_data... [nltk_data] Unzipping corpora/stopwords.zip. [nltk_data] Downloading package punkt to /root/nltk_data... [nltk_data] Unzipping tokenizers/punkt.zip. [nltk_data] Downloading package wordnet to /root/nltk_data... [nltk_data] Unzipping corpora/wordnet.zip. [nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /root/nltk_data... [nltk_data] Unzipping taggers/averaged_perceptron_tagger.zip. Removing intermediate container c2e9af2cebb0 ---> 3ad6c7dd7482 Step 9/11 : RUN python /usr/src/app/manage.py flush --no-input ---> Running in a095170ee199 Traceback (most recent call last): File "/usr/src/app/manage.py", line 15, in

File "/usr/local/lib/python3.7/site-packages/django/db/backends/sqlite3/introspection.py", line 187, in get_primary_key_column raise ValueError("Table %s does not exist" % table_name) ValueError: Table django_admin_log does not exist The command '/bin/sh -c python /usr/src/app/manage.py flush --no-input' returned a non-zero code: 1

OmkarPathak commented 5 years ago

You get this error: ERROR: No such service: build This is because you ran docker-compose up -d build . The right command is: docker-compose up -d build (notice there is no full stop at the end)

goyalnikhil02 commented 5 years ago

I think the issue is not related to "." Issue is related to Table django_admin_log does not exist. The command '/bin/sh -c python /usr/src/app/manage.py flush --no-input' returned a non-zero code: 1 In manage.py you have written the solution ,but not working .

https://stackoverflow.com/questions/27583744/django-table-doesnt-exist

goyalnikhil02 commented 5 years ago

In place of "docker-compose up -d build" command >> docker-compose up -d web

as in docker-compose file services:web

services: web: build: ./resume_parser command: gunicorn resume_parser.wsgi:application --bind 0.0.0.0:8000

Please correct me if i am wrong.

ERROR: Service 'web' failed to build: The command '/bin/sh -c python /usr/src/app/manage.py flush --no-input' returned a non-zero code: 1 I think issue is some where in manage.py

OmkarPathak commented 5 years ago

@goyalnikhil02 are you running docker on windows or linux?

OmkarPathak commented 5 years ago

@goyalnikhil02 I was now able to reproduce the issue. You can see the changes here: Changes. Also, try to run the following command: docker-compose up -d --build

OmkarPathak commented 5 years ago

@goyalnikhil02 do let me know if you are able to resolve the issue so that I can mark this issue as close :smile:

goyalnikhil02 commented 5 years ago

@OmkarPathak docker image is running now but on upload any resume giving the error.

Request Method: | POST

http://ip/ 2.1.5 OperationalError no such table: parser_app_resume /usr/local/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 298 /usr/local/bin/python 3.7.2 ['/usr/src/app', '/usr/local/bin', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/site-packages'] Wed, 27 Mar 2019 05:34:24 +0000

My docker file>>>

FROM python:3 ENV PYTHONUNBUFFERED 1

set work directory

RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY requirements.txt /usr/src/app RUN pip install -r /usr/src/app/requirements.txt COPY . /usr/src/app RUN python /usr/src/app/pre_requisites.py RUN python /usr/src/app/manage.py makemigrations RUN python /usr/src/app/manage.py migrate RUN python /usr/src/app/manage.py collectstatic --no-input

OmkarPathak commented 5 years ago

@goyalnikhil02 try changing

RUN python /usr/src/app/manage.py migrate

to this

RUN python /usr/src/app/manage.py migrate --no-input

in Dockerfile

OmkarPathak commented 5 years ago

@goyalnikhil02 any leads? Should I close this issue?