# Bundle exec rake db:seed error

**URL:** <https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776>\
**Category:** Technical assistance\
**Created:** [June 17, 2020, 9:37am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776 "2020-06-17T09:37:18Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 17, 2020, 9:37am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/1 "2020-06-17T09:37:18Z")

</div>

I am following the installation documentation at [https://docs.zammad.org/en/latest/install/source.html](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?

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [June 19, 2020, 8:24am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/2 "2020-06-19T08:24:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 19, 2020, 9:02am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/3 "2020-06-19T09:02:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 19, 2020, 9:03am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/4 "2020-06-19T09:03:56Z")

</div>

- Used Zammad version: 3.3
- Used Zammad installation source: [https://docs.zammad.org/en/latest/install/source.html](https://docs.zammad.org/en/latest/install/source.html).
- Operating system: debian 10, postgres 11, ruby 2.5.8 (2.5.5 is not available)
- Browser version: shell

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

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 19, 2020, 12:51pm UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/5 "2020-06-19T12:51:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [June 26, 2020, 7:22am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/6 "2020-06-26T07:22:57Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 26, 2020, 7:44am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/7 "2020-06-26T07:44:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 28, 2020, 7:58pm UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/8 "2020-06-28T19:58:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [June 29, 2020, 9:49am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/9 "2020-06-29T09:49:56Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 29, 2020, 10:38am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/10 "2020-06-29T10:38:19Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![herzkerl](https://community.zammad.org/user_avatar/community.zammad.org/herzkerl/32/8167_2.png) [@herzkerl](https://community.zammad.org/u/herzkerl)\
**Post date:** [June 29, 2020, 10:39am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/11 "2020-06-29T10:39:43Z")

</div>

> [@thommierother](#):
>
> The second one needs to be on an lxc container and has a remote postgres 11 database server.

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

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [June 29, 2020, 10:53am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/12 "2020-06-29T10:53:19Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![thommierother](https://community.zammad.org/user_avatar/community.zammad.org/thommierother/32/1776_2.png) [@thommierother](https://community.zammad.org/u/thommierother)\
**Post date:** [July 1, 2020, 7:39am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/13 "2020-07-01T07:39:43Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![herzkerl](https://community.zammad.org/user_avatar/community.zammad.org/herzkerl/32/8167_2.png) [@herzkerl](https://community.zammad.org/u/herzkerl)\
**Post date:** [July 1, 2020, 9:10am UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/14 "2020-07-01T09:10:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [July 1, 2020, 12:31pm UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/15 "2020-07-01T12:31:39Z")

</div>

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.

> <https://github.com/zammad/zammad-documentation/issues/133>
>
> During a source code installation there's no explicit warning that your database… has to be UTF-8.
> Usually this is the case, however, in some rare cases your may have other encodings on your postgreSQL system (for whatever reason).
> 
> This issue occured on the community:
> https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/13
> 
> We should state better which encoding is required.

---

<div class="post-metadata">

**Author:** ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)\
**Post date:** [October 29, 2020, 12:43pm UTC](https://community.zammad.org/t/bundle-exec-rake-db-seed-error/4776/16 "2020-10-29T12:43:31Z")

</div>

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