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

Error when running docker-compose run superdesk-server run python manage.py app:initialize_data #3281

Open
sr33rajv opened this issue Nov 23, 2022 · 21 comments

Comments

@sr33rajv
Copy link

sr33rajv commented Nov 23, 2022

Same issue on Ubuntu 20.x and 18.x
docker-compose run superdesk-server run python manage.py app:initialize_data
Starting root_mongodb_1 ... done
Starting root_elastic_1 ... done
Starting root_redis_1 ... done
waiting for elastic.done.
INFO:superdesk.backend_meta.backend_meta:version of 'superdesk-core': 2.5.dev0
INFO:superdesk.backend_meta.backend_meta:version of 'superdesk-planning': 2.6.0.dev0
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/reportlab/lib/utils.py", line 523, in open_for_read
return open_for_read_by_name(name,mode)
File "/opt/venv/lib/python3.8/site-packages/reportlab/lib/utils.py", line 463, in open_for_read_by_name
return open(name,mode)
FileNotFoundError: [Errno 2] No such file or directory: 'DejaVuSans.ttf'

During handling of the above exception, another exception occurred:

@sr33rajv sr33rajv changed the title Errors when running docker-compose run superdesk-server run python manage.py app:initialize_data after docker install Error when running docker-compose run superdesk-server run python manage.py app:initialize_data Nov 23, 2022
@petrjasek
Copy link
Member

is this on broadcasting branch?

@sr33rajv
Copy link
Author

sr33rajv commented Nov 24, 2022 via email

@petrjasek
Copy link
Member

strange, there is no reportlab required there https://github.com/superdesk/superdesk/blob/master/server/requirements.txt

@petrjasek
Copy link
Member

but if you add fonts-dejavu to https://github.com/superdesk/superdesk/blob/master/server/Dockerfile#L5-L13 it should work

@sr33rajv
Copy link
Author

sr33rajv commented Nov 24, 2022 via email

@bmg1919
Copy link

bmg1919 commented Nov 24, 2022

What other changes have you and/or your team made? I was unable to reproduce this error after adding reportlab to the server requirements. The superdesk core and planning module versions do not match output from the master branch either.

Screenshot from 2022-11-24 11-23-28

On the other hand, you can do as petrjasek said and install the font.

@sr33rajv
Copy link
Author

What other changes have you and/or your team made? I was unable to reproduce this error after adding reportlab to the server requirements. The superdesk core and planning module versions do not match output from the master branch either.

Screenshot from 2022-11-24 11-23-28

We didn't change anything Just tried to install superdesk using this compose file https://github.com/superdesk/superdesk/blob/master/docker-compose.yml

@bmg1919
Copy link

bmg1919 commented Nov 24, 2022

I would start from scratch once more and watch the output.

Once you've cloned the repo into a new folder (git clone https://github.com/superdesk/superdesk.git), run git checkout. The output should be *master. If not, run git checkout master.

Then run sudo docker-compose up -d

That should make superdesk available at localhost:8080. Try logging in with admin/admin or running sudo docker-compose run superdesk-server python manage.py app:initialize_data.

@sr33rajv
Copy link
Author

I would start from scratch once more and watch the output.

Once you've cloned the repo into a new folder (git clone https://github.com/superdesk/superdesk.git), run git checkout. The output should be *master. If not, run git checkout master.

Then run sudo docker-compose up -d

That should make superdesk available at localhost:8080. Try logging in with admin/admin or running sudo docker-compose run superdesk-server python manage.py app:initialize_data.

Tried this but same issue

@bmg1919
Copy link

bmg1919 commented Nov 24, 2022

That should not be possible working off the master branch. Unless it is a regional thing, not allowing you to obtain needed software during the install, but that does not explain why your containers are named differently or why it's obtaining different versions of superdesk-core or planning.

If you do have a newly acquired copy of superdesk, within the folder, try running sudo docker-compose build --no-cache. That should force it to rebuild the server and client regardless of how many times you've attempted to install. Then run sudo docker-compose up -d as usually to start it up and go from there.

@sr33rajv
Copy link
Author

but if you add fonts-dejavu to https://github.com/superdesk/superdesk/blob/master/server/Dockerfile#L5-L13 it should work

The issue seems here when I add the fonts-dejavu in Dockerfile and run the initialize command it works fine.

@bmg1919
Copy link

bmg1919 commented Nov 24, 2022

Screenshot from 2022-11-24 13-07-43

Very true. That does not explain why you're not actually installing from the current master branch. That's where I got stuck on your issue..

@petrjasek
Copy link
Member

seems like an issue with our github action which publishes images on every release, lately we were make some test releases from broadcasting branch where this reportlab is used, but that shouldn't be pushed to dockerhub.

@sr33rajv
Copy link
Author

sr33rajv commented Nov 25, 2022 via email

@petrjasek
Copy link
Member

yep it's updated now

@sr33rajv
Copy link
Author

The new docker image is showing this error /opt/superdesk/docker/start.sh: line 26: exec: run: not found
Screenshot 2022-11-25 at 9 16 44 PM

@petrjasek
Copy link
Member

that's when doing docker-compose up ?

@sr33rajv
Copy link
Author

that's when doing docker-compose up ?

No the error is showing when i run docker-compose run superdesk-server run python manage.py app:initialize_data

@petrjasek
Copy link
Member

imo there should be honcho run before python manage.py

@bmg1919
Copy link

bmg1919 commented Nov 28, 2022

Remove "run" from between superdesk-server and python. You're telling it to run "run" before python, which it can't find, causing it to error out before it has a chance to do anything else. There's most of the problem right there. Sorry it took so long to notice.

@unstence
Copy link

Remove "run" from between superdesk-server and python. You're telling it to run "run" before python, which it can't find, causing it to error out before it has a chance to do anything else. There's most of the problem right there. Sorry it took so long to notice.

This got me past that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants