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

FileNotFound Error [Errno 2] No such file or directory: 'rsvg-convert' #75

Open
Nagarjunakuchi88 opened this issue Mar 1, 2023 · 2 comments

Comments

@Nagarjunakuchi88
Copy link

Nagarjunakuchi88 commented Mar 1, 2023

Team,

We deployed the card generator in production. We are able to do operations like uploading the cards and getting the cards.
But when we try to render the card '/api/v1/cards/{uuid}/render/', getting below error.

sentry log

Installed 'rsvg-convert' by using apt-get install librsvg2-bin

django log
django_1 | INFO 2023-03-01 02:08:20,039 pdf 12 140170532390720 Start rendering #56dbb074-6957-4467-8a7f-3e45174f44b3

FileNotFoundError
[Errno 2] No such file or directory: 'rsvg-convert'

FileNotFoundError: [Errno 2] No such file or directory: 'rsvg-convert'
File "django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "contextlib.py", line 79, in inner
return func(*args, **kwds)
File "django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "rest_framework/viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
File "rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "card_generator/api/v1/cards/views.py", line 37, in render
return Response(data=serializer.data)
File "rest_framework/serializers.py", line 555, in data
ret = super().data
File "rest_framework/serializers.py", line 255, in data
self._data = self.to_representation(self.validated_data)
File "rest_framework/serializers.py", line 522, in to_representation
ret[field.field_name] = field.to_representation(attribute)
File "rest_framework/fields.py", line 1838, in to_representation
return method(value)
File "card_generator/api/v1/cards/serializers.py", line 52, in get_files
return card_render.render()
File "card_generator/cards/pdf.py", line 45, in render
pdf_name = self.render_pdf(name)
File "card_generator/cards/pdf.py", line 70, in render_pdf
convert_svgs(self.svg_files, rsvg_pdf, "pdf")
File "card_generator/cards/utils.py", line 46, in convert_svgs
subprocess.check_call(
File "subprocess.py", line 368, in check_call
retcode = call(*popenargs, **kwargs)
File "subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename);

Please Let us know the what we are missing here.

@Nagarjunakuchi88
Copy link
Author

Seems django docker file is not having 'rsvg-convert' dependencies.

Added ''libxml2-dev libxslt-dev librsvg2-bin mupdf-tools' dependency, now its working.

@jeremi
Copy link
Contributor

jeremi commented Mar 9, 2023

Great, can you do a PR to add it ?

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

2 participants