Bug or User error: MultiSelect field produces an error Invalid Value for field

Infos:

  • Used Zammad version: 5.1.x
  • Used Zammad installation type: (source, package, docker-compose, …) package
  • Operating system: Ubuntu 20.04
  • Browser + version: Firefox 100

Expected behavior:

  • MultiSelect Field allows for choosing one or more values

Actual behavior:

  • MultiSelect Field produces an error - invalid value '[“ABC”, “ZZZ”]; for field “test”!

Steps to reproduce the behavior:

  • Create a new field as MultiSelect and try to create a ticket

I created a field “TEST” as MultiSelect and when I try to create a ticket choosing 2 of the multislect options I get an error invalid value '[“ABC”, “ZZZ”]; for field “test”!

I tried choosing just one value but I still get an error invalid value '[“ABC”]; for field “test”!

Anyone else experience this ?

Well I tried this on another Ubuntu 2 box and same thing. Zammad upgrade seems to go OK.

MultiSelect fields cause the same error.

Either I did something wrong or this is a bug. I’m thinking the latter.

I hope that this post get some traction I would love to use this feature. Until there’s a fixed I rolled the VM back so I’m running Zammad 5.0. I would love to be able to use this feature

Here’s the upgrade steps I used.

Step 1: Ensure dependencies

Before proceeding, double-check that your system environment matches Zammad’s requirements.

Step 2: Stop Zammad

$ systemctl stop zammad

Step 3: Backup Zammad

See Backup and Restore for more information.

Step 4: Clear Zammad cache

$ zammad run rails r “Cache.clear”

Step 5: Update Zammad

$ apt update $ apt upgrade

Warning

The package comes with maintenance scripts that will run regular tasks during updates for you.

However

Do not run Zammad updates unattended and always have a look on the outputs these helper scripts generate. Ignoring said output may lead to incomplete updates that may corrupt data or lead to issues you find way too late.

Step 6: Run required extra steps

Extra steps needed for updates are mentioned in our release news.

Updating Elasticsearch may be relevant in this step.

Step 7: Log into Zammad

Yes, that’s it!

Log file /opt/zammad/log/production.log shows

I, [2022-05-12T12:31:10.630978 #659-182920] INFO – : Started POST “/api/v1/tickets” for 192.168.7.116 at 2022-05-12 12:31:10 -0400
I, [2022-05-12T12:31:10.634714 #659-182920] INFO – : Processing by TicketsController#create as JSON
I, [2022-05-12T12:31:10.635043 #659-182920] INFO – : Parameters: {“title”=>“aaaa”, “group_id”=>“1”, “owner_id”=>“3”, “customer_id”=>“3”, “state_id”=>“2”, “priority_id”=>“2”, “article”=>{“to”=>“Users”, “from”=>“Domenic <domenic@domain.com>”, “body”=>“[FILTERED]”, “type_id”=>5, “sender_id”=>2, “form_id”=>“373083605”, “content_type”=>“text/html”}, “tags”=>“”, “rma”=>“”, “serial_no”=>“”, “product_family”=>“OCM”, “test1”=>[“1”, “2”], “id”=>“c-15”}
E, [2022-05-12T12:31:10.683511 #659-182920] ERROR – : Invalid value ‘[“1”, “2”]’ for field ‘test1’! (Exceptions::ApplicationModel)
app/models/concerns/checks_core_workflow.rb:37:in block in check_restrict_values' app/models/concerns/checks_core_workflow.rb:32:in each_key’
app/models/concerns/checks_core_workflow.rb:32:in check_restrict_values' app/models/concerns/checks_core_workflow.rb:27:in validate_workflows’
app/controllers/tickets_controller.rb:157:in block in create' app/models/transaction.rb:17:in block in execute’
app/models/transaction.rb:14:in execute' app/models/transaction.rb:26:in execute’
app/controllers/tickets_controller.rb:77:in create' app/controllers/application_controller/has_download.rb:21:in block (4 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:20:in block (3 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:19:in block (2 levels) in module:HasDownload
app/controllers/application_controller/handles_transitions.rb:16:in `handle_transaction’
I, [2022-05-12T12:31:10.685618 #659-182920] INFO – : Completed 422 Unprocessable Entity in 50ms (Views: 0.1ms | ActiveRecord: 10.9ms | Allocations: 39314)

Sadly unable to reproduce the error, just created the multi select, restarted services and it works.

Ubuntu22.04 lts, zammad5.1.1, Mysql8-ish, Edge (latest) browser.


Huh I wonder why mine won’t. I tried it on 2 different boxes. This is such a wonderful option its sad I won;t be able to use it.

Ubuntu

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

MariaDB

mysql -v
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 61
Server version: 10.3.34-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Zammad

Version

This is Zammad version 5.1.x

I just tried it again and it won’t go. I noticed the following error in the production log

> E, [2022-05-13T12:48:14.120920 #665-181260] ERROR – : Invalid value ‘[“OK”, “WTF”]’ for field ‘try5’! (Exceptions::ApplicationModel)

What is “ApplicationModel” and is that why the field won’t work?

I, [2022-05-13T12:48:14.051721 #665-181260] INFO – : Started POST “/api/v1/tickets” for 192.168.7.116 at 2022-05-13 12:48:14 -0400
I, [2022-05-13T12:48:14.056586 #665-181260] INFO – : Processing by TicketsController#create as JSON
I, [2022-05-13T12:48:14.056731 #665-181260] INFO – : Parameters: {“title”=>“abc”, “group_id”=>“1”, “owner_id”=>“3”, “customer_id”=>“3”, “state_id”=>“2”, “priority_id”=>“2”, “article”=>{“to”=>“Users”, “from”=>“Domenic domenic@domain.com”, “body”=>“[FILTERED]”, “type_id”=>5, “sender_id”=>2, “form_id”=>“460474833”, “content_type”=>“text/html”}, “tags”=>“”, “rma”=>“”, “serial_no”=>“”, “product_family”=>“”, “try5”=>[“OK”, “WTF”], “id”=>“c-13”}
E, [2022-05-13T12:48:14.120920 #665-181260] ERROR – : Invalid value ‘[“OK”, “WTF”]’ for field ‘try5’! (Exceptions::ApplicationModel)
app/models/concerns/checks_core_workflow.rb:37:in block in check_restrict_values' app/models/concerns/checks_core_workflow.rb:32:in each_key’
app/models/concerns/checks_core_workflow.rb:32:in check_restrict_values' app/models/concerns/checks_core_workflow.rb:27:in validate_workflows’
app/controllers/tickets_controller.rb:157:in block in create' app/models/transaction.rb:17:in block in execute’
app/models/transaction.rb:14:in execute' app/models/transaction.rb:26:in execute’
app/controllers/tickets_controller.rb:77:in create' app/controllers/application_controller/has_download.rb:21:in block (4 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:20:in block (3 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:19:in block (2 levels) in module:HasDownload
app/controllers/application_controller/handles_transitions.rb:16:in `handle_transaction’
I, [2022-05-13T12:48:14.123809 #665-181260] INFO – : Completed 422 Unprocessable Entity in 66ms (Views: 0.1ms | ActiveRecord: 11.4ms | Allocations: 39227)

@gk-helpdesk - Was it a fresh install or an upgrade? Mine was an upgrade, I went from 5.0 to 5.1

Well this is a bust. I have two boxes that allow me to create multiselect fields but they both error out when I try to create a ticket.

So since I was wondering if this issue was somehow related to upgrading Zammad from 5.0 to 5.1 so I just rebuilt a new VM from scratch using Ubuntu 20.04.4 installed Zammad and then I created a multiselect field and same problem

I think the log looks a little bit different

I, [2022-05-13T18:05:45.803998 #679-181420] INFO – : Started POST “/api/v1/tickets” for 192.168.7.116 at 2022-05-13 18:05:45 -0400
I, [2022-05-13T18:05:45.807803 #679-181420] INFO – : Processing by TicketsController#create as JSON
I, [2022-05-13T18:05:45.808089 #679-181420] INFO – : Parameters: {“title”=>“abc”, “group_id”=>“1”, “owner_id”=>“3”, “customer_id”=>“4”, “state_id”=>“2”, “priority_id”=>“2”, “article”=>{“to”=>“Users”, “from”=>“Dd domdis@gdc.com”, “body”=>“[FILTERED]”, “type_id”=>5, “sender_id”=>2, “form_id”=>“479542103”, “content_type”=>“text/html”}, “tags”=>“”, “look”=>[“left”, “up”], “notes”=>“sss”, “id”=>“c-5”}
E, [2022-05-13T18:05:45.847999 #679-181420] ERROR – : Invalid value ‘[“left”, “up”]’ for field ‘look’! (Exceptions::ApplicationModel)
app/models/concerns/checks_core_workflow.rb:37:in block in check_restrict_values' app/models/concerns/checks_core_workflow.rb:32:in each_key’
app/models/concerns/checks_core_workflow.rb:32:in check_restrict_values' app/models/concerns/checks_core_workflow.rb:27:in validate_workflows’
app/controllers/tickets_controller.rb:157:in block in create' app/models/transaction.rb:17:in block in execute’
app/models/transaction.rb:14:in execute' app/models/transaction.rb:26:in execute’
app/controllers/tickets_controller.rb:77:in create' app/controllers/application_controller/has_download.rb:21:in block (4 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:20:in block (3 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:19:in block (2 levels) in module:HasDownload
app/controllers/application_controller/handles_transitions.rb:16:in `handle_transaction’
I, [2022-05-13T18:05:45.850037 #679-181420] INFO – : Completed 422 Unprocessable Entity in 42ms (Views: 0.1ms | ActiveRecord: 7.7ms | Allocations: 35510)

I wonder what all this block (# levels) in module:HasDownload is all about

This is such a bummer. I know you were unable to reproduce it but I reproduced it on 3 different VMs. Two I upgraded to 5.1 and the other a fresh install of 5.1

All Ubuntu 20 and MariaDB

euhm wel mine instance is a little wierd.
it is on my test env where i’m currently testing our comming upgrade.
the default install was 2.5, upgraded to 3.0, upgraded to 4.1.1, upgraded tot 5.1.1.
the initial setup had 5.0 in between, but this was an other trail test run a little differnt way, skipping 5.0.

Install from sources btw.

Thanks for the reply. I appreciate the details on your upgrade path, it puts some of my questions to bed.
I’m not sure what it means when you say installed from source … I followed the instructions on Install from package — Zammad documentation which I believe is “from package”

Is it possible that from package behaves differently than from source?

Which Linux did you use? Which DB did you use?

again many thanks for all the time and input !

Yes its possible that source and package differ. at minimum from installation standpoint.

i’m using in test, Server Ubuntu Server 22.04 LTS, Zammad Installation: from source; MySQL 8.x; Apache2 - PHP7.4.

Again Many Many thanks! ! ! I will try installing from source and see if MultiSelect works. I’ll report back

I tried to install from source but a few of the instructions fail I get to connect to elasticsearch
Connect Zammad with Elasticsearch and the command zammad run rails r “Setting.set(‘es_url’, ‘http://localhost:9200’)” returns zammad: command not found

I guess this is beyond my skill set

So why would the install from package encounter an error when using a multiselect field but it works fine if you install from source ?

Update: I tried to install from source and I still have issues with mutiselect fields.

What’s left:

Try running on Nginx instead of Appache2

or

Try PostgreSQL instead of MariaDB -

:thinking: There’s gotta be an issues some where (I did an upgrade to an existing instance, loaded from scratch as a package, and I loaded from scratch from source), The only thing that remained constant was Apache and MariaDb is there a syntax error for the Apache code or is there a syntax error in the Mariadb code? Here’s a screenshot of the error

I think there’s a bug with Multiselect Fields and MariaDb.

I started from scratch Ubunto 20.04 Apache2, Esatickserach BUT no DB.
I installed Zammad from package and I do believe that it will use PostgreSQL for a default db.

I tried a multiselectfield and it work! So now do I just wait for someone from Zammad to see this post or do I report it as a bug? @MrGeneration could you advise ?

It is definitely a bug in/with/? MariaDB - I’ve tried to create a MultiSelect object with MariaDB and PosgreSQL. It is always an Error by MariaDB and no Error bei PosgreSQL.

It looks to me like the key and value fields are reversed when created in MariaDB. Or the selection queries are not correct.

1 Like

Has this bug been logged ?
Do you know if and or when there may be a fix ?
I want the feature and I’ll wait a short period for it but …

What do you mean with “logged”? In a github von Zammad?

No, I don’t know how to fix it, we move simply to PosgreSQL and so it is no longer relevant for us. Maybe it is also an option for you?

by “logged” I mean reported to developers as a bug

I don’t know how to convert/migrate my MariaDB to PostgreSQL