Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Can't get an FPM pool running #71

Open
outrunthewolf opened this issue May 29, 2015 · 10 comments
Open

Can't get an FPM pool running #71

outrunthewolf opened this issue May 29, 2015 · 10 comments

Comments

@outrunthewolf
Copy link

Excuse my stupidity. I can't seem to get an FPM pool running. Here is my config:

class projects::api {

    include mysql
    php::version { '5.4': }

    # Get the API repo
    repository {
        "${boxen::config::srcdir}/myrepo/api":
            source   => 'myrepo/api',
            provider => 'git';
    }

    $version = '5.4'

    #
    php::fpm::pool { "${name}-${version}":
        version     => $version,
        socket_path => "${boxen::config::socketdir}/${name}",
        require     => File["${nginx::config::sitesdir}/${name}.conf"], 
    }

    # Setup PHP project
    php::project { 'api':
        server_name   => 'api.local.myrepo.in',
        source        => 'moltin/api',
        nginx         => '/opt/boxen/repo/modules/projects/templates/shared/nginx/nginx.conf.erb',
        redis         => true
    }
}

I get various errors with whatever I try, here is my error for this configuration:

Warning: Scope(Class[Projects::Api]): Could not look up qualified variable 'nginx::config::sitesdir'; class nginx::config has not been evaluated
Error: Duplicate declaration: File[/opt/boxen/data/php/5.4.40] is already declared in file /opt/boxen/repo/shared/php/manifests/version.pp:88; cannot redeclare at /opt/boxen/repo/shared/php/manifests/version.pp:88 on node christophersmbp.home
Error: Duplicate declaration: File[/opt/boxen/data/php/5.4.40] is already declared in file /opt/boxen/repo/shared/php/manifests/version.pp:88; cannot redeclare at /opt/boxen/repo/shared/php/manifests/version.pp:88 on node christophersmbp.home

I would be happy to contribute to the docs if I could figure out how it all worked. Thanks.

@outrunthewolf
Copy link
Author

Tried a different version. But it also looks like phpenv isnt installing the executables before its starts to get it running:

Error: Execution of '/bin/launchctl start dev.php-fpm.5.3.23' returned 3:
Error: /Stage[main]/Projects::Api/Php::Project[api]/Php::Fpm::Pool[api-5.3.23]/Php::Fpm[5.3.23]/Php::Fpm::Service[5.3.23]/Service[dev.php-fpm.5.3.23]/ensure: change from stopped to running failed: Execution of '/bin/launchctl start dev.php-fpm.5.3.23' returned 3:

This file does not exist:

    <key>ProgramArguments</key>
    <array>
      <string>/opt/boxen/phpenv/versions/5.3.23/sbin/php-fpm</string>
      <string>--fpm-config</string>
      <string>/opt/boxen/config/php/5.3.23/php-fpm.conf</string>
    </array>

@outrunthewolf
Copy link
Author

Hmm.

Seems to me phpenv does not work at all... It fails miserably. I can't figure out why.

+ [config.source:55] '[' -n '' ']'
+ [phpenv-install:667] trap build_error ERR EXIT
+ [phpenv-install:670] install_release
                         [Fetching] |1| latest code from Github repo

BUILD ERROR: STATUS is 1
The script aborted unexpectedly when a command returned a non zero exit code.
Last 10 linens from the error log file may shed some light
-------------------------------------------------------------------------------------
+ [phpenv-install:193] /opt/boxen/homebrew/bin/git fetch --tags
+ [phpenv-install:188] build_error
+ [phpenv-install:213] [[ 1 -eq 0 ]]
+ [phpenv-install:214] echo
+ [phpenv-install:215] echo 'BUILD ERROR: STATUS is 1'
+ [phpenv-install:216] echo 'The script aborted unexpectedly when a command returned a non zero exit code.'
+ [phpenv-install:217] awk 'END{exit NR == 0};' /tmp/phpenv-install-php-5.4.24.20150529130531.log.err
+ [phpenv-install:218] echo 'Last 10 linens from the error log file may shed some light'
+ [phpenv-install:219] echo -------------------------------------------------------------------------------------
++ [phpenv-install:220] tail -n10 /tmp/phpenv-install-php-5.4.24.20150529130531.log.err

-------------------------------------------------------------------------------------

@outrunthewolf
Copy link
Author

Looks like a permissions issue in the .git folder... Continuing to investigate

@outrunthewolf
Copy link
Author

Which leads me to phpenv... Which is a nightmare of bugs and problems... Build paths are incorrect on versions, directories are not created properly causing it to fail...

How has this package ever worked?...

Is there something other than phpenv?

@outrunthewolf
Copy link
Author

phpenv/phpenv does not work. I would advise possibly moving to this:

https://github.com/CHH/phpenv

travisCI use it seemingly effectively...

@mattheath
Copy link
Member

Hi @outrunthewolf. In your further testing (after it not initially working) are you trying to use phpenv to install php?

I found installation via phpenv didn't work reliably at all, so much so that this module uses a custom puppet provider to provide php_version which does the installation, correctly setting paths etc for configure, which may not be set if you are running phpenv directly on the command line. phpenv itself is only used for switching in the terminal as far as I remember.

  • Your manifest potentially has a couple of duplicate declarations, which may cause the duplicate declaration error.
  • You don't need to specify php::version { '5.4': } in your manifest if you are specifying a php::fpm::pool of the same version, as the fpm pool will set this up
  • Equally the php::project class will also set this up if you specify a php version as a parameter

The php::project class can also set up mysql for you, but note this is an example (as the readme says) so it may not exactly fit your requirements.

@outrunthewolf
Copy link
Author

Thanks @mattheath I've had a terrible 7 hours with this.

I kind of started to figure thats how you were using phpenv, seen as there is zero way it would work without you doing some manipulation somewhere.

Anyway, i've had my hissy fit, cleaned up my config as suggested. I'm still getting this problem.

Error: Execution of '/bin/launchctl start dev.php-fpm.5.3.23' returned 3:
Error: /Stage[main]/Projects::Api/Php::Project[api]/Php::Fpm::Pool[api-5.3.23]/Php::Fpm[5.3.23]/Php::Fpm::Service[5.3.23]/Service[dev.php-fpm.5.3.23]/ensure: change from stopped to running failed: Execution of '/bin/launchctl start dev.php-fpm.5.3.23' returned 3:

I've got to be missing something somewhere.

@mattheath
Copy link
Member

  • Does the /Library/LaunchDaemons/dev.php-fpm.${version}.plist file exist?
  • What is the output of /bin/launchctl start dev.php-fpm.5.3.23 when you run it manually?

@outrunthewolf
Copy link
Author

Yes "/Library/LaunchDaemons/dev.php-fpm.${version}.plist" exists

What is the output of /bin/launchctl start dev.php-fpm.5.3.23 when you run it manually?

The output is 3, which I think is file not found. When I look at the launchdaemon file, its shows fpm as being here:

    <key>ProgramArguments</key>
    <array>
      <string>/opt/boxen/phpenv/versions/5.3.23/sbin/php-fpm</string>
      <string>--fpm-config</string>
      <string>/opt/boxen/config/php/5.3.23/php-fpm.conf</string>
    </array>

None of those files exist...

@sambauers
Copy link

I don't think we are supporting 5.3.X versions at all, only 5.4 or higher.

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

No branches or pull requests

3 participants