kraken-php / framework

Asynchronous & Fault-tolerant PHP Framework for Distributed Applications.
http://kraken-php.com
MIT License
1.12k stars 59 forks source link

PHP Warning: Uncaught Throwable trace: #48

Closed absiddiqueLive closed 8 years ago

absiddiqueLive commented 8 years ago

Composer version 1.2.1 2016-09-12 11:27:19

PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016, by Zend Technologies

composer create-project --prefer-dist kraken-php/kraken .
Installing kraken-php/kraken (v0.3.1)
  - Installing kraken-php/kraken (v0.3.1)
    Loading from cache

Created project in .
> php ./data/script/script.install
string(4) "hej?"
Loading composer repositories with package information
Updating dependencies (including require-dev)
............
............
............
Package guzzle/common is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/stream is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/parser is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/http is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Writing lock file
Generating autoload files
>composer create-project --prefer-dist kraken-php/kraken .
>chmod 777 -R data/log/ data/storage/
>php kraken.server 
Server is booting...
PHP Warning:  Uncaught  Throwable trace:
         0. [WarningError] "require(): data:/ wrapper is disabled in the server configuration by allow_url_include=0" in /ConfigFactory.php:48
        Stack trace:
         0. [throwable] Kraken\Throwable\Error\WarningError(...) in ErrorHandler:63
         1. [call] Kraken\Throwable\ErrorHandler::handleError(2, ""require(): data:// wrapper is d...", "/home/absiddique/Projects/php/kk...", 48, Array) in ConfigFactory:48
         2. [call] Undefinedrequire() in ConfigFactory:48
         3. [call] Kraken\Config\ConfigFactory->Kraken\Config\{closure}() in unknown:0
         4. [call] Undefinedcall_user_func_array(Closure, Array) in SimpleFactoryTrait:128
         5. [call] Kraken\Util\Factory\SimpleFactory->create() in ConfigProvider:180
         6. [call] Kraken\Root\Provider\ConfigProvider->createConfig("/home/absiddique/Projects/php/kk...") in ConfigProvider:239
         7. [call] Kraken\Root\Provider\ConfigProvider->configure(Kraken\Config\Config) in ConfigProvider:103
         8. [call] Kraken\Root\Provider\ConfigProvider->register(Kraken\Root\Console\Server in /home/absiddique/Projects/php/kk/vendor/kraken-php/throwable/ErrorHandler.php on line 63
PHP Fatal error:  Kraken\Config\ConfigFactory::Kraken\Config\{closure}(): Failed opening required 'data://text/plain;base64,PD9waHAKCi8qKgogKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICogRGVmYXVsdCBjb25maWd1cmF0aW9uIGZvciBDb25zb2xlIFNlcnZlci4KICoKICogRm9yIG1vcmUgaW5mb3JtYXRpb24gdmlzaXQ6IGh0dHA6Ly9rcmFrZW4tcGhwLmNvbS9kb2NzCiAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogKi8KcmV0dXJuIFsKICAgIC8qKgogICAgICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAqIEFkZGl0aW9uYWwgY29uZmlndXJhdGlvbiBmaWxlIHRvIGxvYWQuCiAgICAgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICogVGhpcyB2YXJpYWJsZS in /home/absiddique/Projects/php/kk/vendor/kraken-php/config/ConfigFactory.php on line 48
        Throwable trace:
         0. [FatalError] "Kraken\Config\ConfigFactory::Kraken\Config\{closure}(): Failed opening required 'data:/plain;base64,PD9waHAKCi8qKgogKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICogRGVmYXVsdCBjb25maWd1cmF0aW9uIGZvciBDb25zb2xlIFNlcnZlci4KICoKICogRm9yIG1vcmUgaW5mb3JtYXRpb24gdmlzaXQ6IGh0dHA6Ly9rcmFrZW4tcGhwLmNvbS9kb2NzCiAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogKi8KcmV0dXJuIFsKICAgIC8qKgogICAgICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAqIEFkZGl0aW9uYWwgY29uZmlndXJhdGlvbiBmaWxlIHRvIGxvYWQuCiAgICAgKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICogVGhpcyB2YXJpYWJsZS" in /ConfigFactory.php:48
        Stack trace:
         0. [throwable] Kraken\Throwable\Error\FatalError(...) in ErrorHandler:64
         1. [call] Kraken\Throwable\ErrorHandler::handleError(64, ""Kraken\Config\ConfigFactory::Kr...", "/home/absiddique/Projects/php/kk...", 48) in ErrorHandler:80
         2. [call] Kraken\Throwable\ErrorHandler::handleShutdown(1) in EnvironmentProvider:45
         3. [call] Kraken\Root\Provider\EnvironmentProvider->Kraken\Root\Provider\{closure}() in unknown:0
         4. [main]
Killed
khelle commented 8 years ago

You need to enable allow_url_include in your PHP.ini .

absiddiqueLive commented 8 years ago

It's work, but unable to access via browser

>php kraken server:ping
Kraken 0.3.1 by Kamil Jamroz and contributors.

Executing : server:ping ... 
success!
Response  : ip=127.0.1.1
>php kraken project:create
>php kraken project:status
Kraken 0.3.1 by Kamil Jamroz and contributors.

Executing : project:status ... failure!
Response  : Container is currently in failed state and cannot execute any tasks.
Reason    : Kraken\Throwable\Exception\Runtime\RejectionException
>netstat -tplun | grep LI
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:69              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:2060          0.0.0.0:*               LISTEN      18984/php       
tcp        0      0 127.0.0.1:2061          0.0.0.0:*               LISTEN      19053/php7.0    
tcp        0      0 127.0.0.1:465           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:5939          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::69                   :::*                    LISTEN      -               
tcp6       0      0 :::80                   :::*                    LISTEN      -     
khelle commented 8 years ago

From what I see, you are running our application skeleton. Did you make any changes to it? The message Container is currently in failed state and cannot execute any tasks. points out that container went from normal to failed state, which means the uncaught exception has been thrown. Do the logs have any error messages? If not, could you try to run main container via the alternative start method and show the output?

Alternative:

php ./data/autorun/kraken.process undefined Main Main
absiddiqueLive commented 8 years ago

do not made any change !

>php ./data/autorun/kraken.process undefined Main Main
string(41) "\App\Runtime\Container\Main\MainContainer"
Runtime::[Main] is alive and 1476367728
Runtime::[Main] is alive and 1476367729
Runtime::[Main] is alive and 1476367730
Runtime::[Main] is alive and 1476367731
Runtime::[Main] is alive and 1476367732
Runtime::[Main] is alive and 1476367733
Runtime::[Main] is alive and 1476367734
Runtime::[Main] is alive and 1476367735
Runtime::[Main] is alive and 1476367736
Runtime::[Main] is alive and 1476367737
Runtime::[Main] is alive and 1476367738
Runtime::[Main] is alive and 1476367739
absiddiqueLive commented 8 years ago

Now create project giving error !

>php kraken project:create
Kraken 0.3.1 by Kamil Jamroz and contributors.

Executing : project:create ... failure!
Response  : No response was received during specified timeout.
Reason    : Kraken\Throwable\Exception\Runtime\TimeoutException
>php kraken server:ping
Kraken 0.3.1 by Kamil Jamroz and contributors.

Executing : server:ping ... success!
Response  : ip=127.0.1.1
khelle commented 8 years ago

Whenever you run the kraken script you have to ensure that kraken.server is active. Without it, the timeout exception will be returned as there is nothing to connect to. The console server is little bugged as of v0.3 that's why there is an alternative way of starting the project. It seems there is unidentified problem in your cofiguration so for now please stick to alternative method of running the project via :

php ./data/autorun/kraken.process undefined Main Main

As it seems to be working for you fine. The kraken-php/kraken is empty applicaiton skeleton, so nothing will be shown in the browser, as it is clean of any business logic.

absiddiqueLive commented 8 years ago

kraken.server is runing though giving the blow error

>php kraken project:create
Kraken 0.3.1 by Kamil Jamroz and contributors.

Executing : project:create ... failure!
Response  : No response was received during specified timeout.
Reason    : Kraken\Throwable\Exception\Runtime\TimeoutException

Will you please provide total commands to run the project from scratch & also the server port

khelle commented 8 years ago

As I said the console is little buggy as for v0.3. If you restart the console server, the problem with connection will probably solve itself. The alternative method of

 php ./data/autorun/kraken.process undefined Main Main

Will start the whole project just fine, this is the same script that is fired underneath the project:create command. Before we identify the culprit here and apply patches, stick to this method. The only con of this is that you will be unable to use console, but it is not required for making working apps.

kraken-php/kraken is an empty skeleton, it does not have running HTTP server attachd to it so nothing will be shown and there is no working HTTP port. If you want to return something, for example HTTP response, you have to:

  1. create HTTP server - ex : https://github.com/kraken-php/demo-chat/blob/master/app/Provider/Network/NetworkProvider.php
  2. create Routes - ex : https://github.com/kraken-php/demo-chat/blob/master/app/Runtime/Provider/HttpBroker/RoutesProvider.php

If you don't want to do manually and want to experiment with working example that already has HTTP in it, use https://github.com/kraken-php/demo-chat .

khelle commented 8 years ago

I made a note of this problem in #49 .