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

Errors in forks break non HTML pages #424

Closed
hroncok opened this issue Jul 1, 2018 · 6 comments
Closed

Errors in forks break non HTML pages #424

hroncok opened this issue Jul 1, 2018 · 6 comments

Comments

@hroncok
Copy link
Member

hroncok commented Jul 1, 2018

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.

@hroncok hroncok changed the title Errors in forks brek non HTML pages Errors in forks break non HTML pages Jul 1, 2018
@hroncok
Copy link
Member Author

hroncok commented Jul 1, 2018

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.

@encukou
Copy link
Member

encukou commented Jul 1, 2018

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 :(

@hroncok
Copy link
Member Author

hroncok commented Jul 1, 2018

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.

@hroncok
Copy link
Member Author

hroncok commented Jul 1, 2018

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.).

@encukou
Copy link
Member

encukou commented Jul 1, 2018

ACK, I'll do the workaround.

@encukou
Copy link
Member

encukou commented Feb 8, 2019

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

@encukou encukou closed this as completed Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants