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

function 'split' called with mis-matched arguments #63

Open
cova-fe opened this issue Aug 23, 2015 · 4 comments
Open

function 'split' called with mis-matched arguments #63

cova-fe opened this issue Aug 23, 2015 · 4 comments

Comments

@cova-fe
Copy link

cova-fe commented Aug 23, 2015

Hi all, tring to run this module I'm getting this error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, function 'split' called with mis-matched arguments
expected one of:
split(String str, String pattern) - arg count {2}
split(String str, Regexp pattern) - arg count {2}
split(String str, Type[Regexp] pattern) - arg count {2}
actual:
split(Undef, String) - arg count {2} at modules/gluster/manifests/volume.pp:85:22 on node

looking at the code, gluster_brick_group_fact is the variable used and indeed it seems empty.

looking also in facts directory, (tmp/gluster/brick/fsuuid), it contains no files, thus the error.

Unfortunately, I can't understand where can it be the problem. Any hint about where to look? (glusterfs 3.4)

Many thanks.

@purpleidea
Copy link
Owner

@cova-fe Looking at the code, it's actually line 86, so first please check you're running git master.
Secondly, it's this:

    $gluster_brick_group_fact = getvar("gluster_brick_group_${group}")
    $collected_bricks = split($gluster_brick_group_fact, ',')

If this is throwing an error, this looks like it could be different behaviour in puppet4. Can you confirm what versions of things you're using please?

If that's the case, please compare what puppet4 and puppet3.x return for these two variables, and chances are we'd need to add a simple conditional for the split if the empty values are now different.

HTH and looking forward to your detective work and patch!
Cheers,
James

@cova-fe
Copy link
Author

cova-fe commented Aug 24, 2015

Thanks for reply. I'll check asap the puppet4 behaviour, in fact I'm using puppet 4.2.1, and I'll report back.
the line number difference is due to a leftover from some previous debug lines I added trying to understand the situation.

@cova-fe
Copy link
Author

cova-fe commented Aug 24, 2015

One thing that is not clear to me is how the fact about brick is collected. In the machine throwing the error above, there is no volume defined, so I'm perplexed to see an error related to bricks.
Moreover, the only thing set up in manifest is this:

class { '::gluster::simple':
  setgroup => 'virt',       # or: 'small-file-perf', or others too!
  repo => false,
  shorewall => false,
}

I'm not sure where facter collects volume and bricks info, can you point me in the right direction?

Thanks.

@purpleidea
Copy link
Owner

@cova-fe Sure!

The fact is here: https://github.com/purpleidea/puppet-gluster/blob/master/lib/facter/gluster_bricks.rb#L97

Basically when a type runs, in this case, the brick type, it puts little text files in some dir, which are then later read in by the fact. See here:
https://github.com/purpleidea/puppet-gluster/blob/master/manifests/brick.pp#L73

When there are no files yet, you get your error. But you don't need to figure out any of that to fix the bug. Just concentrate on the part I pointed you at in my first comment.

HTH

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