voxpupuli / voxpupuli/puppet-php

A substring operation does not accept a String as a character index

Open
#456 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Puppet
Stars
86
Forks
264
Avg merge
29m
Merged PRs (30d)
1

Description

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.2
  • Module version: 5.3.0
  • Ubuntu 16.04 (both master and agent)

How to reproduce (e.g Puppet code you use)

class { '::php::globals':
    php_version => '7.2'
  } -> class { '::php':
    ensure         => latest,
    manage_repos   => true,
    fpm            => true,
    composer       => true,
    dev            => false,
    pear           => false,
    phpunit        => false,
    package_prefix => 'php7.2-',
    settings   => {
      'PHP/max_execution_time'  => '300',
      'PHP/memory_limit'        => '128M',
      'PHP/post_max_size'       => '100M',
      'PHP/upload_max_filesize' => '100M',
      'Date/date.timezone'      => 'America/Sao_Paulo',
    },
    extensions => {
      pgsql => {
        package_prefix => 'php7.2-',
      },
      gd => {
        package_prefix => 'php7.2-',
      },
      xml => {
        package_prefix => 'php7.2-',
      },
      curl => {
        package_prefix => 'php7.2-',
      },
      mbstring => {
        package_prefix => 'php7.2-',
      },
      mysql => {
        package_prefix => 'php7.2-',
      },
      intl => {
        package_prefix => 'php7.2-',
      },
      gmp => {
        package_prefix => 'php7.2-',
      }
    }
  }

What are you seeing

On agents I get

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: A substring operation does not accept a String as a character index. Expected an Integer (file: /etc/puppetlabs/code/environments/production/modules/php/manifests/globals.pp, line: 20, column: 39) on node uat-ws1","issue_kind":"RUNTIME_ERROR"}
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

What behaviour did you expect instead

The manifest to be applied correctly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with modules/php/manifests/globals.pp at line 20 and reproduce the catalog compilation using the Puppet manifest shown in the issue. Trace the substring operation's character index handling and verify that the manifest applies successfully without the String-index evaluation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.