Bundle exec rake db:seed error

I am following the installation documentation at https://docs.zammad.org/en/latest/install/source.html. Environment is a debian 10, the postgres database 11 is on a separate server. The steps

zammad@host $ rake db:create
zammad@host $ rake db:migrate

can be finished, but

zammad@ticket:~$ bundle exec rake db:seed

crashes with

/opt/zammad/db/seeds.rb:34:in `<top (required)>'
/opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in `load'
/opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in `<main>'

Caused by:
PG::StringDataRightTruncation: ERROR:  value too long for type character varying(500)
/opt/zammad/app/models/translation.rb:466:in `block in to_database'
/opt/zammad/app/models/translation.rb:449:in `to_database'
/opt/zammad/app/models/translation.rb:322:in `block in load_from_file'
/opt/zammad/app/models/translation.rb:317:in `each'
/opt/zammad/app/models/translation.rb:317:in `load_from_file'
/opt/zammad/app/models/translation.rb:23:in `sync'
/opt/zammad/db/seeds.rb:34:in `<top (required)>'
/opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in `load'
/opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in `<main>'

Any idea how to solve this?

Could you please update your first article to hold the issue template that this forum suggest when creating a new post?

It’s quite important to understand scopes better.

I can not edit the original post here (permissions too low), but I can post it again with the template structure

Expected behavior:

  • error-free initialization of database

Actual behavior:

  • zammad@host $ rake db:create
    zammad@host $ rake db:migrate

can be finished, but

zammad@ticket:~$ bundle exec rake db:seed

crashes with

/opt/zammad/db/seeds.rb:34:in <top (required)>' /opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in load’
/opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in `’

Caused by:
PG::StringDataRightTruncation: ERROR: value too long for type character varying(500)
/opt/zammad/app/models/translation.rb:466:in block in to_database' /opt/zammad/app/models/translation.rb:449:in to_database’
/opt/zammad/app/models/translation.rb:322:in block in load_from_file' /opt/zammad/app/models/translation.rb:317:in each’
/opt/zammad/app/models/translation.rb:317:in load_from_file' /opt/zammad/app/models/translation.rb:23:in sync’
/opt/zammad/db/seeds.rb:34:in <top (required)>' /opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in load’
/opt/zammad/.rbenv/versions/2.5.8/bin/bundle:23:in `’

Steps to reproduce the behavior:

  • clean database with rake db: drop and repeat until rake db:seed

Info: Initialisation on a mariadb works without problems.

@MrGeneration if helpful, I can always start the install steps again for testing, but I need advice concerning changes on the ruby stuff as I am more familiar with php and java.

I’m very sorry, I’m afraid I can’t reproduce the issues you describe.
Maybe this has been a temporary problem, to be double check, please fetch the latest stable for Zammad 3.4. Note that this requires ruby 2.6.5 - specific ruby versions can be installed via rvm which might help you.

You can get the latest stable via this link:
https://github.com/zammad/zammad/archive/stable.zip


Please don’t get the following wrong:
If you don’t feel too familar with ruby and source code installations, you may want to switch to the package installation. The package installation does all these manual required steps for you and tries to do as much of your upgrade tasks as possible.

Maybe that’s an alternative that’s the better way for you.

ok, thx for the alternatives, I think I will will try with 3.4. I have a second productive installation with similar environment (proxmox-virtualised), but with mariadb instead of postgres which works fine. But lets see, maybe zammad 3.4 and ruby 3.6 are different.

1 Like

ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux] and zammad 3.4 show the same error with. Something is different when running this product in an lxc container with this version of postgres. As this is the only environmental alternative I have, I will stop further tests and look for another ticketing product.

I’m sorry we couldn’t help you well enough and there wasn’t a working solution for you!
All the best on your journey!

Just for info: we have two zammad instances here, one runs in a proxmox virtualised kvm vm with a remote mariadb as backend - this one is without any problems. The second one needs to be on an lxc container and has a remote postgres 11 database server. Only THIS one is problematic and I have no idea why. And I think its a database issue with postgres, nothing inside the lxc container probably …

Could you elaborate: Why would another installation need to be LXC?

All other applications on the proxmox cluster use lxc containers and the database server is a shared service. I have no “hard facts” why I would need kvm for one database and thus “my own database server”

Just for info: the issue could be finally solved. The created database had wrong encoding (SQL_ASCII) instead of UTF8, therefore some of the sql statements had strings beyond the size limit. If you create the database with

create database zammad with encoding 'UTF8' template=template0

all scripts db:migrate and bundle exec rake db:seed can be finished successfully. The encoding info for the target DB should be added into the installation documentation!

2 Likes

Thank you very much for clarification – I’m glad you’ve got it to work! :raised_hands:

Glad you could solve your issue.
As for the encoding thing this bareely has happened (2 incidents so far).

Anyway, I created an issue for it and will address it when I find time.

1 Like

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