Failed to update snapshot state.. exception: Internal Server Error: No JSON object could be decoded

Just thought i would post a trouble shooting for the error message above.
Not sure what caused it, but i think it was an update to 3.8-12

Please do not run the commands below unless you know what you are doing.

In my log files i had the error posted below:
`[13/Mar/2016 16:25:03] ERROR [storageadmin.middleware:35] Exception occured while processing a request. P
ath: /api/commands/refresh-snapshot-state method: POST
[13/Mar/2016 16:25:03] ERROR [storageadmin.middleware:36] column storageadmin_disk.smart_options does not
exist
LINE 1: …available", “storageadmin_disk”.“smart_enabled”, "storagead…
^
Traceback (most recent call last):
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/core/handlers/base.py”, line 112, in get_respon
se
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/views/decorators/csrf.py”, line 57, in wrapped

view
return view_func(*args, **kwargs)
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/views/generic/base.py”, line 69, in view
return self.dispatch(request, *args, **kwargs)
File “/opt/rockstor/eggs/djangorestframework-3.1.1-py2.7.egg/rest_framework/views.py”, line 452, in dis
patch
response = self.handle_exception(exc)
File “/opt/rockstor/eggs/djangorestframework-3.1.1-py2.7.egg/rest_framework/views.py”, line 449, in dis
patch
response = handler(request, *args, **kwargs)
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/transaction.py”, line 371, in inner
return func(*args, **kwargs)
File “/opt/rockstor/src/rockstor/storageadmin/views/command.py”, line 263, in post
import_snapshots(share)
File “/opt/rockstor/src/rockstor/storageadmin/views/share_helpers.py”, line 133, in import_snapshots
disk = Disk.objects.filter(pool=share.pool)[0].name
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/models/query.py”, line 132, in getitem
return list(qs)[0]
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/models/query.py”, line 96, in iter
self._fetch_all()
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/models/query.py”, line 857, in _fetch_all
self._result_cache = list(self.iterator())
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/models/query.py”, line 220, in iterator
for row in compiler.results_iter():
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/models/sql/compiler.py”, line 713, in result
s_iter
for rows in self.execute_sql(MULTI):
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/models/sql/compiler.py”, line 786, in execut
e_sql
cursor.execute(sql, params)
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/backends/util.py”, line 53, in execute
return self.cursor.execute(sql, params)
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/utils.py”, line 99, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/opt/rockstor/eggs/Django-1.6.11-py2.7.egg/django/db/backends/util.py”, line 53, in execute
return self.cursor.execute(sql, params)
ProgrammingError: column storageadmin_disk.smart_options does not exist
LINE 1: …_available", “storageadmin_disk”.“smart_enabled”, "storagead…
^

[13/Mar/2016 16:25:03] ERROR [smart_manager.data_collector:342] Failed to update snapshot state… excepti
on: Internal Server Error: No JSON object could be decoded`

I solved it by logging into postgressql with:
psql -U rocky storageadmin
with password rocky
Running :
\d storageadmin_disk
Showed columns : smart_options and role missing.

Entering the following commands:
alter table storageadmin_disk add column smart_options character varying(64) ;
alter table storageadmin_disk add column role character varying(256) ;

Solved my problem.

1 Like

That is master reverse engineering skills @Rene_Castberg. Was your machine updated to 3.8-12 from an earlier version or is is a vanilla 3.8-12 install?

This is an issue with db migration that happens as part of the update/install. Do you have this file?
/opt/rockstor/src/rockstor/storageadmin/migrations/0042_auto__add_field_disk_smart_options__add_field_disk_role.py ?

If the file exists, it means migration step failed. If the file doesn’t exist, I’d be very surprised.

Yes i have the file.

It was from a previous unstable version (i had issues with my disks and used the unstable versions for a while) i think -7 but i would have to look at my log files.