DjangoGirls / djangogirls

Website for DjangoGirls.org
http://djangogirls.org/
BSD 3-Clause "New" or "Revised" License
461 stars 283 forks source link

ParseError: no element found: line 1, column 0 #948

Open sentry-io[bot] opened 7 months ago

sentry-io[bot] commented 7 months ago

Sentry Issue: DJANGO-GIRLS-WEBSITE-69

ParseError: no element found: line 1, column 0
(2 additional frame(s) were not displayed)
...
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "story/management/commands/fetch_stories.py", line 24, in handle
    rss = ElementTree.fromstring(response.content)
dostogircse171 commented 6 months ago

@amakarudze Could you please provide me some context and information so I can work on fixing this issue?

marksweb commented 6 months ago

@dostogircse171 This is what we've got;

ParseError: no element found: line 1, column 0
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "story/management/commands/fetch_stories.py", line 24, in handle
    rss = ElementTree.fromstring(response.content)
  File "xml/etree/ElementTree.py", line 1345, in XML
    return parser.close()
Screenshot 2024-02-18 at 02 08 15
dostogircse171 commented 6 months ago

Thank you @marksweb for the details. I think it is better to add an exception handler to avoid this. What do you suggest?

I tried to reproduce it on localhost but couldn't get the issue.

Thank you

marksweb commented 6 months ago

@dostogircse171 yes I think handling exceptions here is the best way forward 👍

vanessa commented 4 months ago

Why would this return 418 I'm a Teapot? 😂