Skip to content

Errors in forks break non HTML pages #424

Closed

Description

@hroncok

When there is an error on a non-HTML page (such as ics), there is a HTML page rendered. That breaks FrozenFlask (expecting text/calendar by the filename, gets text/html).

nauce_error

No idea how we are supposed to handle this, but the current implementation breaks the entire build if this happens.

See #423 (comment) for context.

Activity

  1. changed the title [-]Errors in forks brek non HTML pages[/-] [+]Errors in forks break non HTML pages[/+] on Jul 1, 2018
  2. hroncok commented on Jul 1, 2018

    @hroncok
    MemberAuthor

    For the calendar particularly this is being handled in

    logger.error("There was an error rendering url %s for course '%s'", request.path, course.slug)
    logger.exception(e)
    return render_template(
    "error_in_fork.html",
    malfunctioning_course=course,
    edit_info=get_edit_info(course.edit_path),
    faulty_page="calendar",
    root_slug=model.meta.slug,
    travis_build_id=os.environ.get("TRAVIS_BUILD_ID"),
    )

    We need to return something that has correct content type.

  3. encukou commented on Jul 1, 2018

    @encukou
    Member

    It's actually in the .ics route.

    logger.error("There was an error rendering url %s for course '%s'", request.path, course.slug)
    logger.exception(e)
    return render_template(
    "error_in_fork.html",
    malfunctioning_course=course,
    edit_info=get_edit_info(course.edit_path),
    faulty_page="calendar",
    root_slug=model.meta.slug,
    travis_build_id=os.environ.get("TRAVIS_BUILD_ID"),
    )

    To handle this in a static site we'd need an iCal error page. I don't think that's possible :(

  4. hroncok commented on Jul 1, 2018

    @hroncok
    MemberAuthor

    Right. Well, we can set the content type as a dirty workaround. The static site will then download an ics file with HTML content which isn't great, but at least it would build. Later, we can change the error to plaintext maybe.

  5. hroncok commented on Jul 1, 2018

    @hroncok
    MemberAuthor

    There's a power outage, so I'm on battery and cell data, so don't expect an actual fix/workaround from me any time soon (as it involves pulling docker images etc.).

  6. encukou commented on Jul 1, 2018

    @encukou
    Member

    ACK, I'll do the workaround.

  7. added a commit that references this issue on Jul 1, 2018
  8. encukou commented on Feb 8, 2019

    @encukou
    Member

    No idea how we are supposed to handle this, but the current implementation breaks the entire build if this happens.

    Current implementation breaks the entire build if this happens, as do any errors.
    The plan is that a course will show the last successful build; errors like this will prevent that one course from updating.
    Also, dependencies for new courses are locked using pipenv.

    See #494 for a high-level plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions