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

Internal Server error when msg length is too long. #8

Open
kushurox opened this issue Sep 26, 2022 · 2 comments
Open

Internal Server error when msg length is too long. #8

kushurox opened this issue Sep 26, 2022 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@kushurox
Copy link

I was testing your website and it seems to break when the message length is too large. I have gone through you code and the error seems to be related to the way the msg is being cut into different lines. Even after reading the code responsible for it I couldn't understand how it really works. Sorry couldn't help you with more technical details regarding the error!

parameter provided:
image

@aditeyabaral
Copy link
Owner

Could you post the traceback here? Will help someone else pick it up

@aditeyabaral aditeyabaral added bug Something isn't working good first issue Good for newcomers labels Sep 26, 2022
@kushurox
Copy link
Author

the first error is irrelevant to the issue but when you run the code in the local machine you get this traceback

Traceback (most recent call last):
  File "app/saas.py", line 1, in <module>
    from .utils import createMeme
ImportError: attempted relative import with no known parent package

I think you can fix this by changing the code to
from utils import ...

as for the main error

Traceback (most recent call last):
  File "/home/kushurox/Desktop/spongebob-as-a-service/venv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/kushurox/Desktop/spongebob-as-a-service/venv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/kushurox/Desktop/spongebob-as-a-service/venv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/kushurox/Desktop/spongebob-as-a-service/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/kushurox/Desktop/spongebob-as-a-service/venv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/kushurox/Desktop/spongebob-as-a-service/venv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "app/saas.py", line 37, in meme
    filename = createMeme(captions)
  File "/home/kushurox/Desktop/spongebob-as-a-service/app/utils.py", line 11, in createMeme
    filename = generateImage(captions)
  File "/home/kushurox/Desktop/spongebob-as-a-service/app/utils.py", line 65, in generateImage
    addText(img, position, caption)
  File "/home/kushurox/Desktop/spongebob-as-a-service/app/utils.py", line 121, in addText
    while msg[nextCut] != " ":
IndexError: string index out of range

i think the logic for rendering the text in multiple lines is implemented incorrectly. Ill try my best to read the source when free and come up with solution if it isn't fixed by then by someone else.

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

No branches or pull requests

2 participants