Web UI issues after update

Hey everyone,

I tried to search this issue but no way to find something. I have this issue, today i wanted to use samba share but the rockstor nas was offline. So i tried to restart it and it started but no web UI and samba. So i looked into nas console and tried a couple of different things. I found this command “/opt/rockstor/bin/supervisord -c /opt/rockstor/etc/supervisord.conf” and it started web UI, but there was some BTRFS error. So I looked into disks and my raid1 pool seemed to be empty but both disks run without a problem. I tried to troubleshoot the empty pool in console and found out that they aren’t empty and it’s just some bug. But the pool is somewhat broken. I can’t start share, i managed to mount the pool by this command “mount -o degraded /dev/sdb /mnt2/mypool”. But I can’t manage to make the web UI start after boot and samba share to work at all. My version of rockstor is 3.9.0-7. Sorry for shitty english. I personally think it is some bug or issue with new version of Rockstor but it can be some disk related error as well.

This is my output after trying to start rockstor:

[root@nas ~]# /opt/rockstor/bin/initrock
2017-05-30 22:33:57,274: Supported kernel(/boot/vmlinuz-4.10.6-1.el7.elrepo.x86_64) is already the default
2017-05-30 22:33:57,408: /etc/rc.d/rc.local looks correct. Not updating.
2017-05-30 22:33:57,409: Checking for flash and Running flash optimizations if appropriate.
2017-05-30 22:34:01,192: Updating the timezone from the system
2017-05-30 22:34:01,193: system timezone = Europe/Prague
2017-05-30 22:34:01,194: Updating sshd_config
2017-05-30 22:34:01,196: sshd_config already has the updates. Leaving it unchanged.
2017-05-30 22:34:01,196: Running app database migrations…
Traceback (most recent call last):
File “/opt/rockstor/bin/initrock”, line 45, in
File “/opt/rockstor/src/rockstor/scripts/initrock.py”, line 423, in main
run_command(migration_cmd + [‘storageadmin’])
File “/opt/rockstor/src/rockstor/system/osi.py”, line 114, in run_command
raise CommandException(cmd, out, err, rc)
system.exceptions.CommandException: Error running a command. cmd = /opt/rockstor/bin/django migrate --noinput storageadmin. rc = 1. stdout = [‘Operations to perform:’, ’ Apply all migrations: storageadmin’, ‘Running migrations:’, ’ Rendering model states… DONE’, ’ Applying storageadmin.0003_auto_20170114_1332…’]. stderr = [‘Traceback (most recent call last):’, ’ File “/opt/rockstor/bin/django”, line 44, in ‘, " sys.exit(djangorecipe.manage.main(‘rockstor.settings’))", ’ File “/opt/rockstor/eggs/djangorecipe-1.9-py2.7.egg/djangorecipe/manage.py”, line 9, in main’, ’ management.execute_from_command_line(sys.argv)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/init.py”, line 354, in execute_from_command_line’, ’ utility.execute()’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/init.py”, line 346, in execute’, ’ self.fetch_command(subcommand).run_from_argv(self.argv)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/base.py”, line 394, in run_from_argv’, ’ self.execute(*args, **cmd_options)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/base.py”, line 445, in execute’, ’ output = self.handle(*args, **options)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/core/management/commands/migrate.py”, line 222, in handle’, ’ executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/executor.py”, line 110, in migrate’, ’ self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/executor.py”, line 148, in apply_migration’, ’ state = migration.apply(state, schema_editor)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/migration.py”, line 115, in apply’, ’ operation.database_forwards(self.app_label, schema_editor, old_state, project_state)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/migrations/operations/fields.py”, line 62, in database_forwards’, ’ field,’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/postgresql_psycopg2/schema.py”, line 18, in add_field’, ’ super(DatabaseSchemaEditor, self).add_field(model, field)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/base/schema.py”, line 398, in add_field’, ’ self.execute(sql, params)’, ’ File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/backends/base/schema.py”, line 111, in execute’, ’ 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)’, ‘django.db.utils.ProgrammingError: column “pqgroup_eusage” of relation “storageadmin_share” already exists’, ‘’, ‘’]

@Vojtech_Vidra First off, welcome to the Rockstor community forum.
The problem you have encountered / reported was as a result of a fairly major change from how Rockstor migrates it’s databases and unfortunately things did not go quite as smoothly as was hoped. Anyway the following forum thread coverts this same issue:

Essence a db migration too place but in your case was not properly registered and so a repeat application is attempted and result in failure and the consequent error: hence the:

Essentially if the output of:

/opt/rockstor/bin/django showmigrations --list

shows the last section, “storageadmin”, as having the “0003_auto_20170114_1332” not been applied (ie no cross by it) ie:

[X] 0001_initial
[X] 0002_auto_20161125_0051
[ ] 0003_auto_20170114_1332

Then the migration system thinks it needs applying and so goes ahead and applies it, but the db then responds with it having already been applied and fails.

Only if your commands output this then you can “fake” apply as per @suman post in that thread:

which should then bring the db migrations system up to date with the actual state. Note that you should not update Rockstor further just yet as there is yet another db migration pending that may complicate things. Best get this sorted first. Though once sorted you should be OK, and if so reboot and check before upgrading further.

Hope that helps and let us know how it goes.

So I’ve tried this migrate faking and it seems to get some progress. The rockstor started automatically after reboot, but it still have some issues with certain actions in WebUI. For example when I try to enable SAMBA sharing this error goes off and blocks me from enabling it.

        Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py”, line 41, in _handle_exception
File “/opt/rockstor/src/rockstor/storageadmin/views/user.py”, line 106, in get_queryset
return combined_users()
File “/opt/rockstor/src/rockstor/storageadmin/views/ug_helpers.py”, line 69, in combined_users
temp_uo.pincard_allowed, temp_uo.has_pincard = pincard_states(temp_uo) # noqa E501
File “/opt/rockstor/src/rockstor/system/pinmanager.py”, line 146, in pincard_states
pincard_present = has_pincard(user)
File “/opt/rockstor/src/rockstor/system/pinmanager.py”, line 129, in has_pincard
pins = Pincard.objects.filter(user=int(uid_field)).count()
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/query.py”, line 318, in count
return self.query.get_count(using=self.db)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/sql/query.py”, line 466, in get_count
number = obj.get_aggregation(using, [’__count’])[’__count’]
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/sql/query.py”, line 447, in get_aggregation
result = compiler.execute_sql(SINGLE)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/sql/compiler.py”, line 840, 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)
ProgrammingError: relation “storageadmin_pincard” does not exist
LINE 1: SELECT COUNT(*) AS “__count” FROM “storageadmin_pincard” WHE…

But BTRFS seems to be working just fine. I did manage to enable AFP and connect to share, but I am still getting “BTRFS error (device sda): parent transid verify failed on 811483250688 wanted 85423 found 85419”. At the time my machine runs rockstor 3.9.0-8. Tried these files: https://github.com/rockstor/rockstor-core/pull/1694/commits/473eabb2a379ffb11c46aed68a836b826bde0e34 but nothing seems to be different.