Codeigniter V 3.6.1 build failed in google app engine flexible environment

483 views
Skip to first unread message

Dhandapani Sattanathan

unread,
Dec 21, 2017, 6:31:49 AM12/21/17
to Google App Engine
Hi,

I could not deploy CI(Codeignter framework) in app engine flexible environment.This one deployed and build successfully past 1 years. Don't know what newly changed in google app engine flexible with CI framework.

Download the latest version CI 3.6.1 in this url - https://github.com/bcit-ci/CodeIgniter/releases

composer.json

{
 
"description": "The CodeIgniter framework",
 
"name": "codeigniter/framework",
 
"type": "project",
 
"homepage": "https://codeigniter.com",
 
"license": "MIT",
 
"support": {
 
"forum": "http://forum.codeigniter.com/",
 
"wiki": "https://github.com/bcit-ci/CodeIgniter/wiki",
 
"irc": "irc://irc.freenode.net/codeigniter",
 
"source": "https://github.com/bcit-ci/CodeIgniter"
 
},
 
"require": {
 
"php": "7.1.*"
 
},
 
"suggest": {
 
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
 
},
 
"require-dev": {
 
"mikey179/vfsStream": "1.1.*",
 
"phpunit/phpunit": "4.* || 5.*"
 
}
}

app.yaml
runtime: php
env
: flex

runtime_config
:
   document_root
: .

manual_scaling
:
   instances
: 1

handlers
:

- url: .*
  script
: index.php

I got this error log after build failed

starting build "52af3cdc-055e-478b-8f2a-19e8ddbfce55" FETCHSOURCE Fetching storage object: gs://staging.sample.appspot.com/us.gcr.io/sample/appengine/ci.20171221t152021:latest#1513849896698778 Copying gs://staging.sample.appspot.com/us.gcr.io/sample/appengine/ci.20171221t152021:latest#1513849896698778... / [0 files][ 0.0 B/ 2.1 MiB] / [1 files][ 2.1 MiB/ 2.1 MiB] Operation completed over 1 objects/2.1 MiB. BUILD Starting
Step #0 Step #0: Pulling image: gcr.io/gcp-runtimes/php/gen-dockerfile@sha256:88d42e0b05a9c68586389a534be3f7756c65a2fb7a7051eaf3eeb8455fe6e4a4
Step #0: sha256:88d42e0b05a9c68586389a534be3f7756c65a2fb7a7051eaf3eeb8455fe6e4a4: Pulling from gcp-runtimes/php/gen-dockerfile
Step #0: Digest: sha256:88d42e0b05a9c68586389a534be3f7756c65a2fb7a7051eaf3eeb8455fe6e4a4
Step #0: Status: Downloaded newer image for gcr.io/gcp-runtimes/php/gen-dockerfile@sha256:88d42e0b05a9c68586389a534be3f7756c65a2fb7a7051eaf3eeb8455fe6e4a4
Step #0: + php /builder/create_dockerfile.php create --php72-image gcr.io/google-appengine/php72@sha256:1d7320a8535e8de3c61860039d803e3c001bfde03cea35f0b23de1ca5e3f25e7 --php71-image gcr.io/google-appengine/php71@sha256:018752b8603f06916979b57a2d216f6ad3dd5a9ff344df583e5197edfe41dfd1 --php70-image gcr.io/google-appengine/php70@sha256:cf9060fb09d4488c720ec87ffac4d101ae24d70bf01e9d6a80cc10274e5b23ce --php56-image gcr.io/google-appengine/php56@sha256:bc540bab322d3a1de6059b7a4e981f4a80fe619ac09da391615896255b80ff55
Step #0: Step #0: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 216
Step #0: Step #0: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 159
Step #0: Step #0: Fatal error: Uncaught Error: Unsupported operand types in /builder/src/Builder/GenFilesCommand.php:261
Step #0: Stack trace:
Step #0: #0 /builder/src/Builder/GenFilesCommand.php(148): Google\Cloud\Runtimes\Builder\GenFilesCommand->createDockerfile('gcr.io/google-a...')
Step #0: #1 /builder/vendor/symfony/console/Command/Command.php(252): Google\Cloud\Runtimes\Builder\GenFilesCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #0: #2 /builder/vendor/symfony/console/Application.php(936): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #0: #3 /builder/vendor/symfony/console/Application.php(240): Symfony\Component\Console\Application->doRunCommand(Object(Google\Cloud\Runtimes\Builder\GenFilesCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #0: #4 /builder/vendor/symfony/console/Application.php(148): Symfony\Component\Conso in /builder/src/Builder/GenFilesCommand.php on line 261
Step #0: [21-Dec-2017 09:51:47 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 216 Step #0: [21-Dec-2017 09:51:47 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 159 Step #0: [21-Dec-2017 09:51:47 UTC] PHP Fatal error: Uncaught Error: Unsupported operand types in /builder/src/Builder/GenFilesCommand.php:261
Step #0: Stack trace: Step #0: #0 /builder/src/Builder/GenFilesCommand.php(148): Google\Cloud\Runtimes\Builder\GenFilesCommand->createDockerfile('gcr.io/google-a...') Step #0: #1 /builder/vendor/symfony/console/Command/Command.php(252): Google\Cloud\Runtimes\Builder\GenFilesCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #0: #2 /builder/vendor/symfony/console/Application.php(936): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #0: #3 /builder/vendor/symfony/console/Application.php(240): Symfony\Component\Console\Application->doRunCommand(Object(Google\Cloud\Runtimes\Builder\GenFilesCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #0: #4 /builder/vendor/symfony/console/Application.php(148): Symfony\Component\Conso in /builder/src/Builder/GenFilesCommand.php on line 261 Finished
Step #0 ERROR ERROR: build step "gcr.io/gcp-runtimes/php/gen-dockerfile@sha256:88d42e0b05a9c68586389a534be3f7756c65a2fb7a7051eaf3eeb8455fe6e4a4" failed: exit status 255

Please help me what went wrong. Is anything need to add in composer.json?

Thanks
SN

George (Cloud Platform Support)

unread,
Dec 21, 2017, 11:38:08 AM12/21/17
to Google App Engine
Hello Dhandapani,

To use a particular web framework, just add it to composer.json:

{
    "require": {
        "symfony/symfony": " ^3.0"
    }
}

In your case, this statement should refer to Codeigniter, not Symfony. 

There are quite a few references to Symfony in the error messages displayed during building. Did you attempt to install that framework? 

Is there any particular reason why you choose PHP 7.1 in your composer.json file? 

"require": {
 "php": "7.1.*"
 },

If you don't specify any version in composer.json, 7.2 gets installed. By default, the PHP runtime uses PHP 7.2, but you should explicitly declare your PHP version in the composer.json file to prevent your application from being automatically upgraded when a new version of PHP becomes available. 

You may benefit from more related detail, if you read the "Using PHP Libraries" documentation page

Dhandapani Sattanathan

unread,
Dec 22, 2017, 3:28:37 AM12/22/17
to Google App Engine
Thanks George,

Before upgrade PHP 7.2, to use the latest version of PHP in GAE using like this.GAE Flexible environment Codeigniter worked fine.

"require": {
 "php": "7.1.*"
 },

Now it using PHP 7.2 by default.

To use a particular web framework, just add it to composer.json:

{
    "require": {
        "codeigniter/codeigniter": " ^3.1.6"
    }
}
I got issues. So I tried like this composer.json, I updated version php >=7.2.0

{
"description": "The CodeIgniter framework",
"name": "codeigniter/framework",
"type": "project",
"homepage": "https://codeigniter.com",
"license": "MIT",
"support": {
},
"require": {
"php": ">=7.2.0"
},
"suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
},
"require-dev": {
"mikey179/vfsStream": "1.1.*",
"phpunit/phpunit": "4.* || 5.*"
}
}

Now CodeIgniter builds successfully in GAE flexible environment.

George (Cloud Platform Support)

unread,
Dec 22, 2017, 4:24:17 PM12/22/17
to Google App Engine
Most grateful for your post above, that contains the detailed solution. People affected by the same issue will find your solution and profit from the time saved this way. 
Reply all
Reply to author
Forward
0 new messages