markhuot / craftql

A drop-in GraphQL server for Craft CMS
Other
320 stars 53 forks source link

TypeError: Failed to fetch after Craft-Upate #343

Open nelhop opened 3 years ago

nelhop commented 3 years ago

After Updating to the latest Craft version (Craft Pro 3.6.11.1) GraphQL (1.3.6) is broken:

2021-03-29 20:22:03 [-][1][-][error][TypeError] TypeError: Argument 1 passed to GraphQL\Executor\ExecutionResult::toArray() must be of the type int, null given, called in /[...]/vendor/markhuot/craftql/src/Services/GraphQLService.php on line 132 and defined in /[...]/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php:136
Stack trace:
#0 /[...]/vendor/markhuot/craftql/src/Services/GraphQLService.php(132): GraphQL\Executor\ExecutionResult->toArray(NULL)
#1 /[...]/vendor/markhuot/craftql/src/Controllers/ApiController.php(121): markhuot\CraftQL\Services\GraphQLService->execute(Object(GraphQL\Type\Schema), '\n  query Intros...', NULL)
#2 [internal function]: markhuot\CraftQL\Controllers\ApiController->actionIndex()
#3 /[...]/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /[...]/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#5 /[...]/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('index', Array)
#6 /[...]/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('index', Array)
#7 /[...]/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('craftql/api/ind...', Array)
#8 /[...]/vendor/yiisoft/yii2/web/Application.php(104): craft\web\Application->runAction('craftql/api/ind...', Array)
#9 /[...]/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))
#10 /[...]/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 /[...]/web/index.php(21): yii\base\Application->run()
#12 {main}
2021-03-29 20:22:02 [-][1][-][info][application] $_GET = [
    'p' => 'api'
]

$_POST = []

$_FILES = []

$_COOKIE = [
    '1031b8c41dfff97a311a7ac99863bdc5_username' => 'ee40456fda5ccf9810185a5504f61b43de501cc14e984902c9c1576eff5ecec7a:2:{i:0;s:41:\"1031b8c41dfff97a311a7ac99863bdc5_username\";i:1;s:5:\"admin\";}'
    'CRAFT_CSRF_TOKEN' => '•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    'CraftSessionId' => '0a31b59a26a816c3729922bd24dddb30'
    '1031b8c41dfff97a311a7ac99863bdc5_identity' => '0c25ef7edc0d57e7bc59d214e0546e680763e36e6945ef306ef010345608934fa:2:{i:0;s:41:\"1031b8c41dfff97a311a7ac99863bdc5_identity\";i:1;s:248:\"[\"1\",\"[\\\"r5zMYhRz1tUopQ0N8pB-YSGb3a1r7ZFTmDATjRf96cken9cw9AZISSrvgtun9k_iaogJ2vUDJ1hKRx9j4M6Gac3RjHJ_ID5Owgzl\\\",null,\\\"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36\\\"]\",3600]\";}'
    '__stripe_mid' => 'bce38157-58ff-4951-8234-80f599f5457618a80b'
    '__stripe_sid' => '5b13044a-7f3c-468d-b1c5-eb786ce6b9bf9dfd4d'
]

$_SESSION = [
    'bd62416aa8538ede709019a5e113eea5__flash' => []
    '1031b8c41dfff97a311a7ac99863bdc5__token' => '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
    '1031b8c41dfff97a311a7ac99863bdc5__id' => '1'
    '1031b8c41dfff97a311a7ac99863bdc5__expire' => 1617045722
    'enableDebugToolbarForSite' => true
    'enableDebugToolbarForCp' => true
    'assetsVolumesBeingIndexed' => [
        0 => '1'
        1 => '3'
        2 => '4'
        3 => '5'
        4 => '6'
        5 => '8'
        6 => '9'
    ]
    'assetsMissingFolders' => [
        143 => 'Termine/2020/vortraege/2021/05.12.2020/'
        145 => 'Termine/2020/vortraege/2021/06.02.2021/'
        142 => 'Termine/2020/vortraege/2021/07.11.2020/'
        144 => 'Termine/2020/vortraege/2021/09.01.2021/'
        141 => 'Termine/2020/vortraege/2021/10.10.2020/'
        146 => 'Termine/2020/vortraege/2021/13.03.2021/'
    ]
    'assetsSkippedFiles' => []
    'pluginStoreConnectRedirectUrl' => 'https://xxx/admin/plugin-store'
]

$_SERVER = [
    'PATH' => '/usr/local/bin:/usr/bin:/bin'
    'REDIRECT_STATUS' => '200'
    'UNIQUE_ID' => 'xxx'
    'SCRIPT_URL' => '/api'
    'SCRIPT_URI' => 'https://xxx/api'
    'HTTP_AUTHORIZATION' => 'Bearer by1TmnZsu8Btvdcn9gdGLAFuOMZqBmwxvqRHjBdjcyy1KPV0OjHxbmfMc8OhbYQL'
    'SWFFONTPATH' => '/usr/lib/libswf/fonts/'
    'PDFLIBRESOURCE' => '/usr/local/fonts/pdflib.upr'
    'HTTPS' => 'on'
    'SSL_TLS_SNI' => 'xxx'
    'SSL_SERVER_S_DN_OU' => 'Domain Control Validated'
    'SSL_SERVER_S_DN_CN' => '*.xxx'
    'SSL_SERVER_I_DN_C' => 'US'
    'SSL_SERVER_I_DN_ST' => 'Arizona'
    'SSL_SERVER_I_DN_L' => 'Scottsdale'
    'SSL_SERVER_I_DN_O' => 'Starfield Technologies, Inc.'
    'SSL_SERVER_I_DN_OU' => 'http://certs.starfieldtech.com/repository/'
    'SSL_SERVER_I_DN_CN' => 'Starfield Secure Certificate Authority - G2'
    'SSL_SERVER_SAN_DNS_0' => '*.xxx'
    'SSL_SERVER_SAN_DNS_1' => 'xxx'
    'SSL_VERSION_INTERFACE' => 'mod_ssl/2.4.46'
    'SSL_VERSION_LIBRARY' => 'OpenSSL/1.0.2l'
    'SSL_PROTOCOL' => 'TLSv1.2'
    'SSL_SECURE_RENEG' => 'true'
    'SSL_COMPRESS_METHOD' => 'NULL'
    'SSL_CIPHER' => 'ECDHE-RSA-AES128-GCM-SHA256'
    'SSL_CIPHER_EXPORT' => 'false'
    'SSL_CIPHER_USEKEYSIZE' => '128'
    'SSL_CIPHER_ALGKEYSIZE' => '128'
    'SSL_CLIENT_VERIFY' => 'NONE'
    'SSL_SERVER_M_VERSION' => '3'
    'SSL_SERVER_M_SERIAL' => 'FD887927C4FB8EE4'
    'SSL_SERVER_V_START' => 'Aug 24 08:02:36 2020 GMT'
    'SSL_SERVER_V_END' => 'Sep 22 06:30:53 2021 GMT'
    'SSL_SERVER_S_DN' => 'CN=*.xxx,OU=Domain Control Validated'
    'SSL_SERVER_I_DN' => 'CN=Starfield Secure Certificate Authority - G2,OU=http://certs.starfieldtech.com/repository/,O=Starfield Technologies\\, Inc.,L=Scottsdale,ST=Arizona,C=US'
    'SSL_SERVER_A_KEY' => '•••••••••••••'
    'SSL_SERVER_A_SIG' => 'sha256WithRSAEncryption'
    'SSL_SESSION_ID' => 'b3256a5c83e0ef1cadce8804bef38e8b297af6234931520557662a084fde6535'
    'SSL_SESSION_RESUMED' => 'Resumed'
    'CONTENT_LENGTH' => '1517'
    'HTTP_SEC_CH_UA' => '\"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\"'
    'HTTP_ACCEPT' => 'application/json'
    'HTTP_SEC_CH_UA_MOBILE' => '?0'
    'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36'
    'CONTENT_TYPE' => 'application/json'
    'HTTP_ORIGIN' => 'https://xxx'
    'HTTP_SEC_FETCH_SITE' => 'same-origin'
    'HTTP_SEC_FETCH_MODE' => 'cors'
    'HTTP_SEC_FETCH_DEST' => 'empty'
    'HTTP_REFERER' => 'https://xxx/admin/craftql/browse/by1TmnZsu8Btvdcn9gdGLAFuOMZqBmwxvqRHjBdjcyy1KPV0OjHxbmfMc8OhbYQL'
    'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, br'
    'HTTP_ACCEPT_LANGUAGE' => 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'
    'HTTP_COOKIE' => '1031b8c41dfff97a311a7ac99863bdc5_username=ee40456fda5ccf9810185a5504f61b43de501cc14e984902c9c1576eff5ecec7a%3A2%3A%7Bi%3A0%3Bs%3A41%3A%221031b8c41dfff97a311a7ac99863bdc5_username%22%3Bi%3A1%3Bs%3A5%3A%22admin%22%3B%7D; CRAFT_CSRF_TOKEN=ee8e189b4bab6a7831aad40035c6a71ecf5d669b328f0c167c306cae0f67089ba%3A2%3A%7Bi%3A0%3Bs%3A16%3A%22CRAFT_CSRF_TOKEN%22%3Bi%3A1%3Bs%3A208%3A%22SZMk5ZJT-UWvX2GJEyMg8r9VqbT0fIMteYBMlzT8%7Cc5e445dc66e9eccccd0e45b315f60b0ef8bb31dc2ce16201050eaed1a197c263SZMk5ZJT-UWvX2GJEyMg8r9VqbT0fIMteYBMlzT8%7C1%7C%242y%2413%24YDwy8jmCLwiS7SgXTfO21uDgm4WuvmzuVm08rLqPIp.5KxbIesCVW%22%3B%7D; CraftSessionId=0a31b59a26a816c3729922bd24dddb30; 1031b8c41dfff97a311a7ac99863bdc5_identity=0c25ef7edc0d57e7bc59d214e0546e680763e36e6945ef306ef010345608934fa%3A2%3A%7Bi%3A0%3Bs%3A41%3A%221031b8c41dfff97a311a7ac99863bdc5_identity%22%3Bi%3A1%3Bs%3A248%3A%22%5B%221%22%2C%22%5B%5C%22r5zMYhRz1tUopQ0N8pB-YSGb3a1r7ZFTmDATjRf96cken9cw9AZISSrvgtun9k_iaogJ2vUDJ1hKRx9j4M6Gac3RjHJ_ID5Owgzl%5C%22%2Cnull%2C%5C%22Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+11_2_3%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F89.0.4389.90+Safari%2F537.36%5C%22%5D%22%2C3600%5D%22%3B%7D; __stripe_mid=bce38157-58ff-4951-8234-80f599f5457618a80b; __stripe_sid=5b13044a-7f3c-468d-b1c5-eb786ce6b9bf9dfd4d'
    'HTTP_HOST' => 'xxx'
    'SERVER_SOFTWARE' => 'Apache'
    'SERVER_NAME' => 'xxx'
    'SERVER_ADDR' => '2a00:1158:1000:300::417'
    'SERVER_PORT' => '443'
    'REMOTE_ADDR' => '2003:fb:c71a:3c73:75c3:8c5:db0a:7d71'
    'DOCUMENT_ROOT' => '/[...]/web'
    'SERVER_ADMIN' => 'webmaster@xxx'
    'SCRIPT_FILENAME' => '/[...]/web/index.php'
    'REMOTE_PORT' => '64848'
    'REDIRECT_URL' => '/api'
    'REDIRECT_QUERY_STRING' => 'p=api'
    'GATEWAY_INTERFACE' => 'CGI/1.1'
    'SERVER_PROTOCOL' => 'HTTP/2.0'
    'REQUEST_METHOD' => 'POST'
    'QUERY_STRING' => 'p=api'
    'REQUEST_URI' => '/api'
    'SCRIPT_NAME' => '/index.php'
    'DOCROOT' => '/[...]/web'
    'DOC_ROOT' => '/[...]/web'
    'PHPRC' => './:/etc/php.ini/7/425037/493800:/etc/php.ini/7/425037:/usr/local/php73-SECURE'
    'PHP_SELF' => '/index.php'
    'REQUEST_TIME_FLOAT' => 1617042122.2695
    'REQUEST_TIME' => 1617042122
    'argv' => [
        0 => 'p=api'
    ]
    'argc' => 1
    'ENVIRONMENT' => 'production'
    'SECURITY_KEY' => '••••••••••••••••••••••••••••••••'
    'DB_DRIVER' => 'mysql'
    'DB_SERVER' => 'xxx'
    'DB_USER' => 'xxx'
    'DB_PASSWORD' => '••••••••••••'
    'DB_DATABASE' => 'db425037_10'
    'DB_SCHEMA' => 'public'
    'DB_TABLE_PREFIX' => 'craft_'
    'DB_PORT' => '3306'
    'SITE_URL' => 'xxx'
    'ASSETS_URL' => 'xxx'
]
redboer commented 3 years ago

This is duplicate to #342 and has a solution proposed in #344

nelhop commented 3 years ago

Thanks, @redboer. You are right, the solution you proposed fixes it for me.