mage2tv / magento-cache-clean

A faster drop in replacement for bin/magento cache:clean with file watcher
BSD 3-Clause "New" or "Revised" License
527 stars 61 forks source link

Crashing on watch #79

Closed lfolco closed 4 years ago

lfolco commented 4 years ago

Getting this error since upgrading to 1.2.8:

/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:361
function ij(a){Z.g(Nh,T(["Reading app config by shelling out to php"]));a=hj(a);if(!t(wi(a)))throw Tg(["File env.php not found: ",a].join(""),ve);a=gj.execSync(["php -r \"echo json_encode((require '",a,"') ?? []);\""].join(""));a=Pg(Qi(a),T([Qg,!0]));return Re.b(ve,a)}
                                                                                             ^
Sg [Error]: File env.php not found: /Users/lfolco/Sites/coffee/local/m2cof/app/etc/env.php
    at new Sg (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:328:24)
    at Tg (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:329:75)
    at ij (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:361:100)
    at Function.g [as m] (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:161:240)
    at Function.<anonymous> (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:371:18)
    at ke (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:141:272)
    at oe (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:146:119)
    at e (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:370:341)
    at d (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:370:204)
    at Nj (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:371:75) {
  message: 'File env.php not found: /Users/lfolco/Sites/coffee/local/m2cof/app/etc/env.php',
  data: Xa { o: null, j: 0, c: [], v: -15128758, i: 16647951, B: 139268 },
  bc: null,
  name: 'Error',
  description: undefined,
  fileName: undefined,
  lineNumber: undefined,
  columnNumber: undefined,
  stack: 'Error: File env.php not found: /Users/lfolco/Sites/coffee/local/m2cof/app/etc/env.php\n' +
    '    at new Sg (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:328:24)\n' +
    '    at Tg (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:329:75)\n' +
    '    at ij (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:361:100)\n' +
    '    at Function.g [as m] (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:161:240)\n' +
    '    at Function.<anonymous> (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:371:18)\n' +
    '    at ke (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:141:272)\n' +
    '    at oe (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:146:119)\n' +
    '    at e (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:370:341)\n' +
    '    at d (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:370:204)\n' +
    '    at Nj (/Users/lfolco/Sites/coffee/local/m2cof/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:371:75)'
}
gjportegies commented 4 years ago

@lfolco does the file env.php exists? Should be located /Users/lfolco/Sites/coffee/local/m2cof/app/etc/env.php (https://devdocs.magento.com/guides/v2.3/config-guide/prod/config-reference-envphp.html)

lfolco commented 4 years ago

It does.

Vinai commented 4 years ago

Okay... this is a strange one. What is the exact command that you use to invoke the script?

lfolco commented 4 years ago

vendor/bin/cache-clean.js -w

Vinai commented 4 years ago

Could you please run it with the -w -vv flags and paste the full output here? Thank you.

lfolco commented 4 years ago

Oh snap my bad: I was running data migrations repeatedly and resetting the Magento environment with each iteration, so indeed there was no env.php.

Nothing else to see here, folks, let's just move it along like this never happened...