Value too long for type character varying(128) (new install)

I just installed Rockstor 3 to an HP Compaq computer with a Core 2 Duo processor. I am trying to add drives, but I received this error message:

        Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py”, line 41, in _handle_exception
yield
File “/opt/rockstor/src/rockstor/storageadmin/views/disk.py”, line 377, in post
return self._update_disk_state()
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/utils/decorators.py”, line 145, in inner
return func(*args, **kwargs)
File “/opt/rockstor/src/rockstor/storageadmin/views/disk.py”, line 316, in _update_disk_state
p.disk_set.add(dob)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/fields/related.py”, line 750, in add
obj.save()
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/base.py”, line 734, in save
force_update=force_update, update_fields=update_fields)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/base.py”, line 762, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/base.py”, line 846, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/base.py”, line 885, in _do_insert
using=using, raw=raw)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/manager.py”, line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/query.py”, line 920, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/sql/compiler.py”, line 974, in execute_sql
cursor.execute(sql, params)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/utils.py”, line 98, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
DataError: value too long for type character varying(128)

@revclstoner Welcome to the Rockstor communiy.

Yes, this is caused by very long device names and has been fixed in newer versions of Rockstor. If this is a new install you would be best advised to simply re-install using our Rockstor 4 variant via the DIY installer instructions here:

That way you get all the latest updates and are moved over to our newer OS base. I.e. Rockstor 4 is now “Built on openSUSE”.

The problem is that device names ended up, over time, betting very long. And so we had to extend a database field so that it could accomodate the really long device names that we ended up failing on such as in your case.

The issue raised when we first had this reported was this one:

and it’s fix to the database was in this pull request:

Which was merged in Rockstor version 3.9.2-53 in the Stable Channel:

11th Feb 2020.

N.B. we only extended the device name database ‘slot’ to 192 characters. So if you experience the same with Rockstor version > 3.9.2-53 or any Rockstor 4 version then do please let us know here as you would then have our record for longest reported device name. Just saying.

Hope that helps and thanks for the report.

1 Like