Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create a new share on the rockstor_rockstor pool and quota error #1907

Closed
razaborg opened this issue Mar 14, 2018 · 3 comments
Closed

Comments

@razaborg
Copy link

razaborg commented Mar 14, 2018

Hi,

This is my setup :
2 pools:

  • 1 rockstor_rockstor pool with 1 SSD, only the OS
  • 1 data_volume pool with 2 HDD, RAID 1, everything else

I wanted to create a new share on my first pool (rockstor_rockstor), to see how faster this share could be on an SSD drive...

But this error showed-up :

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/share.py", line 187, in post
    share_pqgroup_assign(pqid, s)
  File "/opt/rockstor/src/rockstor/fs/btrfs.py", line 889, in share_pqgroup_assign
    mnt_pt = mount_root(pool)
  File "/opt/rockstor/src/rockstor/fs/btrfs.py", line 930, in qgroup_assign
    # and deal by returning False so our caller moves on.
CommandException: Error running a command. cmd = /sbin/btrfs qgroup assign 0/1177 2015/15 /mnt2//rockstor_rockstor. rc = 1. stdout = ['']. stderr = ['ERROR: unable to assign quota group: Invalid argument', '']

Fine. I then tried to create the same share on my other pool (2 HDD, RAID 1), just to see what happen... And the share was just created successfully...

I tried to remove the Quota on the rockstor_rockstor, and then, a new error showed-up :

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/pool.py", line 351, in put
    'level: %s' % raid_level)
TypeError: %d format: a number is required, not unicode

This is clearly a Python programming issue. But that does not explain the first error. :(

@razaborg razaborg changed the title Unable to create a new share on the rockstor_rockstor pool Unable to create a new share on the rockstor_rockstor pool and quota error Mar 14, 2018
@phillxnet
Copy link
Member

@razaborg Thanks for reporting your findings.
Using latest stable I am able to create a share on the system pool (usually rockstor_rockstor) with quotas enabled or disabled. Could you report the displayed Rockstor version (top right) and confirm it with:

yum info rockstor

as root user.

Thanks.

What look odd is that a code comment is showing in your Traceback:

# and deal by returning False so our caller moves on.

Have you hand edited the code or edited the traceback before posting as I haven't see this before?

As to your second point "I tried to remove the Quota on the rockstor_rockstor," a quota disabled state is only supported in the very latest stable release channel currently. Prior to that there are multiple breakages with quotas disabled.

Also to your: "This is clearly a Python programming issue. But that does not explain the first error. :("
agreed and there is an ongoing effort to resolve this type of error going forward via:
"root pool edit message formatting type error" #1847
which includes reviving our unit test to help prevent this going forward.
It's actually what I'm currently working on.

@razaborg
Copy link
Author

razaborg commented Mar 14, 2018

Here is the output of yum info rockstor:

Paquets installés
Nom                 : rockstor
Architecture        : x86_64
Version             : 3.9.2
Révision            : 19
Taille              : 77 M
Dépôt               : installed
Depuis le dépôt     : Rockstor-Stable
Résumé              : RockStor -- Store Smartly
Licence             : GPL
Description         : RockStor -- Store Smartly

For the record, I subscribed for the stable update releases plan, so I should have the latest stable version available : RockStor 3.9.2-19

And no, I didn't either edited manually the code nor the traceback before posting it here. I did it again to check and the error still shows up like that.
It's strange and I haven't ever seen that before either. Here is a copy of this part of the code:

def qgroup_destroy(qid, mnt_pt):
    cmd = [BTRFS, 'qgroup', 'show', mnt_pt]
    try:
        o, e, rc = run_command(cmd, log=True)
    except CommandException as e:
        # we may have quotas disabled so catch and deal.
        emsg = "ERROR: can't list qgroups: quotas not enabled"
        if e.err[0] == emsg:
            # we have quotas disabled so can't destroy any anyway so skip
            # and deal by returning False so our caller moves on.
            return False
        # otherwise we raise an exception as normal
        raise e
    for l in o:
        if (re.match(qid, l) is not None and l.split()[0] == qid):
            return run_command([BTRFS, 'qgroup', 'destroy', qid, mnt_pt],
                               log=True)
    return False

@phillxnet
Copy link
Member

Closing for now as this relates to a now old and legacy base OS version of Rockstor.

@razaborg If you can reproduce this issue on our new "Built on openSUSE" base derived form one of our installers do please re-open this issue. We have had quite a few in-code and upstream fixes in the interim, plus of course the change form CentOS to openSUSE so hopefully things should be far better for your in this respect now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants