Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitDeployer::updateFile(): Argument #1 ($value) must be of type string, null given #664

Closed
brianjhanson opened this issue May 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@brianjhanson
Copy link

Bug Report

It looks like maybe the types on GitDeployer::updateFile are a little too strong. $value has the ability to be null when using the FileStorage driver. It looks like updateFile would handle null values, but I'm getting a type error from PHP.

2024-05-14 22:40:15 [console.ERROR] [TypeError] putyourlightson\blitz\drivers\deployers\GitDeployer::updateFile(): Argument #1 ($value) must be of type string, null given, called in file/path/vendor/putyourlightson/craft-blitz/src/drivers/deployers/GitDeployer.php on line 147

{
  "trace": [
    "#0 file/path/vendor/putyourlightson/craft-blitz/src/drivers/deployers/GitDeployer.php(147): putyourlightson\\blitz\\drivers\\deployers\\GitDeployer->updateFile()",
    "#1 file/path/vendor/putyourlightson/craft-blitz/src/drivers/deployers/BaseDeployer.php(52): putyourlightson\\blitz\\drivers\\deployers\\GitDeployer->deployUrisWithProgress()",
    "#2 file/path/vendor/putyourlightson/craft-blitz/src/console/controllers/CacheController.php(587): putyourlightson\\blitz\\drivers\\deployers\\BaseDeployer->deployUris()",
    "#3 file/path/vendor/putyourlightson/craft-blitz/src/console/controllers/CacheController.php(309): putyourlightson\\blitz\\console\\controllers\\CacheController->deploy()",
    "#4 [internal function]: putyourlightson\\blitz\\console\\controllers\\CacheController->actionRefresh()",
    "#5 file/path/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()",
    "#6 file/path/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()",
    "#7 file/path/vendor/yiisoft/yii2/console/Controller.php(180): yii\\base\\Controller->runAction()",
    "#8 file/path/vendor/yiisoft/yii2/base/Module.php(552): yii\\console\\Controller->runAction()",
    "#9 file/path/vendor/yiisoft/yii2/console/Application.php(180): yii\\base\\Module->runAction()",
    "#10 file/path/vendor/craftcms/cms/src/console/Application.php(91): yii\\console\\Application->runAction()",
    "#11 file/path/vendor/yiisoft/yii2/console/Application.php(147): craft\\console\\Application->runAction()",
    "#12 file/path/vendor/craftcms/cms/src/console/Application.php(122): yii\\console\\Application->handleRequest()",
    "#13 file/path/vendor/yiisoft/yii2/base/Application.php(384): craft\\console\\Application->handleRequest()",
    "#14 file/path/craft(13): yii\\base\\Application->run()",
    "#15 {main}"
  ],
  "memory": 30980064,
  "exception": "[object] (TypeError(code: 0): putyourlightson\\blitz\\drivers\\deployers\\GitDeployer::updateFile(): Argument #1 ($value) must be of type string, null given, called in file/path/vendor/putyourlightson/craft-blitz/src/drivers/deployers/GitDeployer.php on line 147 at file/path/vendor/putyourlightson/craft-blitz/src/drivers/deployers/GitDeployer.php:340)"
}

Diagnostics Report

Application Info

  • PHP version: 8.1.2
  • Craft edition & version: Pro 4.9.2
  • Database driver & version: MySQL 8.0.36

Installed Plugins

  • Blitz: 4.18.0
  • Bulk Edit: 4.0.1
  • Element API: 3.0.1.1
  • Embedded Assets: 3.2.0
  • Feed Me: 5.4.0
  • Formie: 2.1.14
  • Imager X: 4.4.0
  • KeyChain: 4.0.0
  • Neo: 3.9.11
  • Redactor: 3.0.4
  • SAML Service Provider: 4.1.1
  • SendGrid: 2.0.1
  • SEOmatic: 4.0.48
  • Smith: 2.0.1
  • Super Table: 3.0.14
  • Table Maker: 4.0.11
  • Typed link field: 2.1.5
  • Typogrify: 4.0.3

Loaded Modules

  • dcvc: modules\DCVC
  • getro: modules\getrojobsmodule\GetroJobsModule
  • codeeditor: nystudio107\codeeditor\CodeEditor
  • sprig-core: putyourlightson\sprig\Sprig
  • blitz-hints: putyourlightson\blitzhints\BlitzHints
  • verbb-base: verbb\base\Base

Blitz Plugin Settings

{
    "debug": true,
    "hintsEnabled": true,
    "cachingEnabled": true,
    "refreshCacheEnabled": true,
    "refreshMode": 3,
    "includedUriPatterns": [
        {
            "siteId": "",
            "uriPattern": ".*"
        },
        {
            "siteId": "",
            "uriPattern": "content-types\/.*"
        },
        {
            "siteId": "",
            "uriPattern": "content-types"
        },
        {
            "siteId": "",
            "uriPattern": "content-types\/index.html"
        },
        {
            "siteId": 1,
            "uriPattern": "content-topics\/.*"
        },
        {
            "siteId": 1,
            "uriPattern": "content-topics"
        },
        {
            "siteId": 1,
            "uriPattern": "content-topics\/index.html"
        },
        {
            "siteId": 1,
            "uriPattern": "news-insights\/archive\/.*"
        },
        {
            "siteId": 1,
            "uriPattern": "news-insights\/archive"
        }
    ],
    "excludedUriPatterns": [
        {
            "siteId": 1,
            "uriPattern": "\/block-library"
        }
    ],
    "cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\FileStorage",
    "cacheStorageSettings": {
        "folderPath": "@root\/blitz\/cache",
        "createGzipFiles": false,
        "countCachedFiles": true
    },
    "cacheStorageTypes": [],
    "cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\LocalGenerator",
    "cacheGeneratorSettings": {
        "concurrency": 5
    },
    "cacheGeneratorTypes": [],
    "customSiteUris": [
        {
            "siteId": 1,
            "uri": "\/search"
        },
        {
            "siteId": 1,
            "uri": "\/content-topics"
        }
    ],
    "cachePurgerType": "putyourlightson\\blitz\\drivers\\purgers\\DummyPurger",
    "cachePurgerSettings": [],
    "cachePurgerTypes": [],
    "deployerType": "putyourlightson\\blitz\\drivers\\deployers\\GitDeployer",
    "deployerSettings": {
        "gitRepositories": {
            "88bb7ef8-41f5-46d5-a33a-b5c80c65aff9": {
                "repositoryPath": "@root\/blitz\/repo",
                "branch": "develop",
                "remote": "origin"
            }
        },
        "commitMessage": "Blitz auto commit {{ now|date('c') }}",
        "username": "***",
        "personalAccessToken": "****************************************",
        "name": "DCVC Build",
        "email": "****",
        "commandsBefore": "cd \/storage\/av08978\/www\/dev\/releases\/306 && CRAFT_SITE_URL=https:\/\/craft4-dev.dcvc.com PUBLIC_SITE_URL=https:\/\/develop--dcvc-static.netlify.app sh blitz\/scripts\/pre-deploy.sh 2>&1 | tee -a storage\/logs\/blitz-pre-deploy.log",
        "commandsAfter": ""
    },
    "deployerTypes": [],
    "ssiEnabled": false,
    "ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
    "detectSsiEnabled": true,
    "esiEnabled": false,
    "queryStringCaching": 0,
    "includedQueryStringParams": [
        {
            "siteId": 1,
            "queryStringParam": ".*"
        }
    ],
    "excludedQueryStringParams": [
        {
            "siteId": 1,
            "queryStringParam": "gclid"
        },
        {
            "siteId": 1,
            "queryStringParam": "fbclid"
        }
    ],
    "apiKey": "",
    "generatePagesWithQueryStringParams": true,
    "purgeAssetImagesWhenChanged": true,
    "refreshCacheAutomaticallyForGlobals": true,
    "refreshCacheWhenElementMovedInStructure": true,
    "refreshCacheWhenElementSavedUnchanged": true,
    "refreshCacheWhenElementSavedNotLive": true,
    "cacheNonHtmlResponses": false,
    "trackElements": true,
    "trackElementQueries": true,
    "excludedTrackedElementQueryParams": [],
    "cacheElements": true,
    "cacheElementQueries": true,
    "cacheDuration": 0,
    "nonCacheableElementTypes": [],
    "sourceIdAttributes": [],
    "liveStatuses": [],
    "integrations": [
        "putyourlightson\\blitz\\drivers\\integrations\\FeedMeIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\SeomaticIntegration"
    ],
    "defaultCacheControlHeader": "no-store",
    "cacheControlHeader": "public, s-maxage=31536000, max-age=0",
    "cacheControlHeaderExpired": "public, max-age=5",
    "sendPoweredByHeader": false,
    "outputComments": false,
    "refreshCacheJobPriority": 10,
    "driverJobBatchSize": 100,
    "driverJobPriority": 100,
    "queueJobTtr": 300,
    "maxRetryAttempts": 10,
    "maxUriLength": 255,
    "mutexTimeout": 1,
    "commands": {
        "git": "REDACTED"
    },
    "injectScriptEvent": "DOMContentLoaded",
    "injectScriptPosition": 3
}

Recommendations

  • ❌ Blitz is configured to refresh cached pages when an element is saved but remains unchanged.
  • ❌ Blitz is configured to refresh cached pages when an element is saved but not live.
  • ❌ One or more globals exist and refreshCacheAutomaticallyForGlobals is enabled.
  • ❌ Queue jobs are configured to run automatically via web requests.
  • ❌ The Blitz Hints utility is reporting 27 eager-loading opportunities.
  • ✅ Image transforms are configured to be generated before page load.
  • ✅ The @web alias is not used in the base URL of any sites.
  • ✅ The Async Queue plugin is not installed or enabled.
  • ✅ The blitz/cache/refresh-expired console command has been executed within the past 24 hours.

Site Tracking

  • Tracked Pages: 483
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 1404
    • craft\elements\Entry: 660
    • craft\elements\Asset: 645
    • craft\elements\Category: 98
    • verbb\formie\elements\Form: 1
  • Tracked Element Queries: 1184
    • craft\elements\Entry: 1,175
    • craft\elements\Category: 9
  • Tracked Tags: 1
@brianjhanson brianjhanson added the bug Something isn't working label May 15, 2024
@bencroker
Copy link
Collaborator

Thanks, Brian! Fixed in f824ac5 for the next release.

@bencroker
Copy link
Collaborator

Released in 4.18.1 and 5.3.1.

@brianjhanson
Copy link
Author

Beautiful. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants