Website Form fails in Preview - 500 - ArgumentError

Hi,

  • Used Zammad version: 6.2.0-1705920690.db7738e0.jammy
  • Used Zammad installation type: package
  • Operating system: Ubuntu 22.04
  • Browser + version: Edge, Chrome, Firefox - latest

Expected behavior:

Feedback Form should Send and create a Ticket

Actual behavior:

Form Fails in Preview

Steps to reproduce the behavior:

Enable Form in Options and test in in the Preview

{Failed to load resource: the server responded with a status of 500 ()}

Production Log:

F, [2024-01-25T10:07:37.514569#8037-142620] FATAL -- :   
[099c400e-0321-428c-b0f6-11f21c5b1d81] ArgumentError (comparison of Integer with String failed):

[9ded3509-07b6-4b0c-a23c-cd27afcea6de]   
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack-attack (6.7.0) lib/rack/attack/throttle.rb:41:in `>'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack-attack (6.7.0) lib/rack/attack/throttle.rb:41:in `matched_by?'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack-attack (6.7.0) lib/rack/attack/configuration.rb:91:in `block in throttled?'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack-attack (6.7.0) lib/rack/attack/configuration.rb:90:in `any?'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack-attack (6.7.0) lib/rack/attack/configuration.rb:90:in `throttled?'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack-attack (6.7.0) lib/rack/attack.rb:118:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/tempfile_reaper.rb:15:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/etag.rb:27:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/conditional_get.rb:40:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/head.rb:12:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/http/permissions_policy.rb:38:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/http/content_security_policy.rb:36:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/session/abstract/id.rb:266:in `context'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/session/abstract/id.rb:260:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/cookies.rb:704:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] activesupport (7.0.8) lib/active_support/callbacks.rb:99:in `run_callbacks'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/show_exceptions.rb:29:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] railties (7.0.8) lib/rails/rack/logger.rb:40:in `call_app'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] railties (7.0.8) lib/rails/rack/logger.rb:25:in `block in call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] activesupport (7.0.8) lib/active_support/tagged_logging.rb:99:in `block in tagged'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] activesupport (7.0.8) lib/active_support/tagged_logging.rb:37:in `tagged'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] activesupport (7.0.8) lib/active_support/tagged_logging.rb:99:in `tagged'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] railties (7.0.8) lib/rails/rack/logger.rb:25:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/request_id.rb:26:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/method_override.rb:24:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/runtime.rb:22:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/executor.rb:14:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/static.rb:23:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] rack (2.2.8) lib/rack/sendfile.rb:110:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] actionpack (7.0.8) lib/action_dispatch/middleware/host_authorization.rb:131:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] railties (7.0.8) lib/rails/engine.rb:530:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] railties (7.0.8) lib/rails/railtie.rb:226:in `public_send'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] railties (7.0.8) lib/rails/railtie.rb:226:in `method_missing'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/configuration.rb:272:in `call'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/request.rb:100:in `block in handle_request'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/thread_pool.rb:378:in `with_force_shutdown'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/request.rb:99:in `handle_request'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/server.rb:464:in `process_client'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/server.rb:245:in `block in run'
[9ded3509-07b6-4b0c-a23c-cd27afcea6de] puma (6.4.2) lib/puma/thread_pool.rb:155:in `block in spawn_thread'

Zammad.Error.log:
2024/01/25 10:53:33 [error] 8870#8870: *8 connect() failed (111: Unknown error) while connecting to upstream, client: 83.135.x.x, server: support.company.de, request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:6042/ws", host: "support.company.de"

On the Website it fails with:

company.de/:1  Access to XMLHttpRequest at 'https://support.compandy.de/api/v1/form_submit' from origin 'https://company.de' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
jquery-3.6.0.min.js:2         
        
        POST https://support.company.de/api/v1/form_submit net::ERR_FAILED 500 (Internal Server Error)```

Seems the main problem after submitting the Form is

[2024-01-25T10:07:37.514569#8037-142620] FATAL – :
[099c400e-0321-428c-b0f6-11f21c5b1d81] ArgumentError (comparison of Integer with String failed):

Anybody got something here?

But is the problem now inside the preview of the live usage of the form code?

Same here since the last update.
For us it’s the production environment…so suddenly the production form did not work anymore.
The error message is exactly the same.

Turns out we followed the documentation here a bit too closely: /en/latest/channels/form.html

rails> Setting.set('form_ticket_create_by_ip_per_day','50')
rails> Setting.set('form_ticket_create_by_ip_per_hour','10')

We executed the following commands:

zammad run rails r "Setting.set('form_ticket_create_by_ip_per_hour','10')"
zammad run rails r "Setting.set('form_ticket_create_by_ip_per_day','10')"

setting the values to strings instead of integers. This was done simultaneously to updating the software which made us think it was due to the update.

Running

zammad run rails r "Setting.set('form_ticket_create_by_ip_per_hour',10)"
zammad run rails r "Setting.set('form_ticket_create_by_ip_per_day',10)"

fixed the issue.

1 Like

Thanks. That fixed it for me too.

/en/5.0/channels/form.html

form_ticket_create_per_day is also wrong with ‘500’

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.