Re: [Puppet Users] A substring operation does not accept a String as a charachter index

3,521 views
Skip to first unread message

Rob Nelson

unread,
Dec 16, 2016, 10:20:43 AM12/16/16
to puppet...@googlegroups.com
I think it should be File[] (capital F) rather than file[] on line 6
On Fri, Dec 16, 2016 at 9:42 AM Andoreasu <api....@gmail.com> wrote:
Hello together,

we change from Puppet 3 to Puppet 4. In some of our Modules, we get Error message while the node is retrieving the catalog from the master server.

It always said:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Serve
r
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluati
on
Error: A substring operation does not accept a String as a character index. E
xpected an
Integer at /etc/puppetlabs/code/environments/development/modules/inst
all_oracle12cdriver
/manifests/init.pp:6:19 on node testnode01.testdomain.de
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Its hears a little bit likes this, but i dont see a solution... https://tickets.puppetlabs.com/browse/PUP-6480

A module where this happens for example:

class install_oracle12cdriver{

   
package { 'oracle12cdriver':
       
ensure => installed,
        provider
=> 'chocolatey',
       
require => file['c:/Oracle', 'c:/Oracle/client.rsp'],
        source
=> 'http://choco01/chocorepo/chocolatey/',
   
}

    file
{ 'c:/Oracle/client.rsp':
        source
=> 'puppet:///modules/install_oracle12cdriver/client.rsp',
        source_permissions
=> ignore,
   
}

    file
{ 'c:/Oracle':
       
ensure => 'directory',
        source_permissions
=> ignore,
   
}
}


Does anyone know what i can do? Its totaly strange to me. In Puppet 3 everything works fine.

Thanks for any help

best regards









--


You received this message because you are subscribed to the Google Groups "Puppet Users" group.


To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/dddc2816-5f35-45cc-b61d-7fe0a033a090%40googlegroups.com.


For more options, visit https://groups.google.com/d/optout.


--
Rob Nelson

Henrik Lindberg

unread,
Dec 16, 2016, 6:33:10 PM12/16/16
to puppet...@googlegroups.com
On 16/12/16 15:42, Andoreasu wrote:
> Hello together,
>
> we change from Puppet 3 to Puppet 4. In some of our Modules, we get
> Error message while the node is retrieving the catalog from the master
> server.
>
> It always said:
>
> |
> Error:Couldnotretrieve catalog fromremote server:Error500on SERVER:Serve
> r Error:EvaluationError:Errorwhileevaluating a ResourceStatement,Evaluati
> on Error:A substring operation does notaccept a Stringasa character index.E
> xpected an Integerat
> /etc/puppetlabs/code/environments/development/modules/inst
> all_oracle12cdriver/manifests/init.pp:6:19on node testnode01.testdomain.de
> Warning:Notusingcache on failed catalog
> Error:Couldnotretrieve catalog;skipping run
> |
>
> Its hears a little bit likes this, but i dont see a solution...
> https://tickets.puppetlabs.com/browse/PUP-6480
>
> A module where this happens for example:
>
> |
> classinstall_oracle12cdriver{
>
> package{'oracle12cdriver':
> ensure=>installed,
> provider =>'chocolatey',
> require=>file['c:/Oracle','c:/Oracle/client.rsp'],

File['c:/Oracle','c:/Oracle/client.rsp'] (captial F). What you have
there now means the same as:
"file"['c:/Oracle','c:/Oracle/client.rsp'] which is a failed attempt to
get one or more characters out of the string "file" - i.e. you can do
"file"[2,2] to get the substring "il".

So, you are getting an error since the index to get substring from a
string requires one or two integers and you have a file path there.

Hope that helps.
- henrik

> source =>'http://choco01/chocorepo/chocolatey/',
> }
>
> file {'c:/Oracle/client.rsp':
> source =>'puppet:///modules/install_oracle12cdriver/client.rsp',
> source_permissions =>ignore,
> }
>
> file {'c:/Oracle':
> ensure=>'directory',
> source_permissions =>ignore,
> }
> }
> |
>
>
> Does anyone know what i can do? Its totaly strange to me. In Puppet 3
> everything works fine.
>
> Thanks for any help
>
> best regards
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> <https://groups.google.com/d/msgid/puppet-users/dddc2816-5f35-45cc-b61d-7fe0a033a090%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Reply all
Reply to author
Forward
0 new messages