500 error, stuck in a loop

Environment

Discourse Version: v3.1.0.beta2 +607

Plugin Commit: 345885bd

Steps to Reproduce

A user created a topic and the text in one the fields caused a liquid syntax error. They first saw the !doctype.HTML error on the wizard, now they are stuck with a 500 error when visiting the wizard again. I was able to repro this by using their text, but not otherwise. They put in `This handsome male pileated woodpecker is a daily visitor to our backyard suet block. It’s my buddy “Woody” (Woody Woodpecker’s look was inspired by a pileated).', now I’m stuck with the 500 error. I tried turning on “Clear submissions on each visit.” and it did not help.

Example

Angus still has admin access to view this

Logs

Liquid::SyntaxError (Liquid syntax error: Expected end_of_string but found id in ““This handsome male pileated woodpecker is a daily visitor to our backyard suet block. It’s my buddy “Woody” (Woody Woodpecker’s look was inspired by a pileated).” != “””)
app/controllers/application_controller.rb:414:in block in with_resolved_locale' app/controllers/application_controller.rb:414:in with_resolved_locale’
lib/middleware/omniauth_bypass_middleware.rb:74:in call' lib/content_security_policy/middleware.rb:12:in call’
lib/middleware/anonymous_cache.rb:369:in call' config/initializers/008-rack-cors.rb:24:in call’
config/initializers/100-quiet_logger.rb:20:in call' config/initializers/100-silence_logger.rb:29:in call’
lib/middleware/enforce_hostname.rb:24:in call' lib/middleware/request_tracker.rb:228:in call’

Also another user got an error with this:
Liquid::SyntaxError (Liquid syntax error: Unexpected character ! in ““Sedona averages one inch of snow a year. I happened to be there when it received 12” of snow in one day. It was a photographers dream!” != “”")
app/controllers/application_controller.rb:414:in block in with_resolved_locale' app/controllers/application_controller.rb:414:in with_resolved_locale’
lib/middleware/omniauth_bypass_middleware.rb:74:in call' lib/content_security_policy/middleware.rb:12:in call’
lib/middleware/anonymous_cache.rb:369:in call' config/initializers/008-rack-cors.rb:24:in call’
config/initializers/100-quiet_logger.rb:20:in call' config/initializers/100-silence_logger.rb:29:in call’
lib/middleware/enforce_hostname.rb:24:in call' lib/middleware/request_tracker.rb:228:in call’

And the wizard:
nature-photographers-network-wizards-1678929807.json (13.8 KB)

Unable to repro this atm, I used both of these strings and there was no error.

Any more information that might help me reproduce?

(ignore the image problem, that’s just a domain mapping issue on my dev).

I will test again on prod, once we have subscriptions working on our test environments.

Thanks to ChatGPT and a lot of experimentation, I think I have cleaned up the liquid code to fix this. Still waiting for some users to try it out, but I cannot repro anymore. I have learned a lot about liquid through this process. Here’s what my code looks like for anyone that may be trying to achieve something similar.

![{{ step_1_field_1 }}]({{ step_1_field_3.url }})

{% if step_1_field_2 != blank %}
### Image Description
{{ step_1_field_2 }}
{% endif %}

{% if step_3_field_1 != blank %}
![Image 2]({{ step_3_field_1.url }})
{{ step_3_field_2 }}
{% endif %}

{% if step_3_field_3 != blank %}
![Image 3]({{ step_3_field_3.url }})
{{ step_3_field_4 }}
{% endif %}

{% if step_3_field_5 != blank %}
![Image 4]({{ step_3_field_5.url }})
{{ step_3_field_6 }}
{% endif %}

{% if step_1_field_12 == "true" or step_1_field_13 == "true" or step_1_field_14 == "true" or step_1_field_15 == "true" %}
### Type of Critique Requested
{% if step_1_field_12 == "true" %}
  - Aesthetic: Feedback on the overall visual appeal of the image, including its color, lighting, cropping, and composition.
{% endif %}
{% if step_1_field_13 == "true" %}
  - Conceptual: Feedback on the message and story conveyed by the image.
{% endif %}
{% if step_1_field_14 == "true" %}
  - Emotional: Feedback on the emotional impact and artistic value of the image.
{% endif %}
{% if step_1_field_15 == "true" %}
  - Technical: Feedback on the technical aspects of the image, such as exposure, color, focus and reproduction of colors and details, post-processing, and print quality.
{% endif %}
{% endif %}

### Specific Feedback and Self-Critique
{{ step_1_field_9 }}

{% if step_1_field_8 != blank %}
### Technical Details
{{ step_1_field_8 }}
{% endif %}
3 Likes