With some kind help i was able to track down the offending code.
By using BuskaMuza's suggestion of adding verbose to bin/magento setup:upgrade -vvv
i was able to track down the file where the error was being kicked. It's super common in M1 to just look at the first line of the error and work with that to figure out the solution, but in this case it was buried in the stack trace. While my exact solution might not work for everyone, i wanted to post it here so anyone searching might be able to track down their error.
In the stack trace, there was a line that referenced the module that was kicking the error when i tried to compile. I know that it was this module because disabling just that module would compile fine. Once enabled, the error would kick when it got to processing that one (you can see that module name as the last one called before the error).
That line in my case is {{vendor}}\{{module}}\Setup\InstallData->install()
giving me the clue that Ryan H suggested. By looking at the line in the stack trace right above it calls out the file in the module and the line that has the error Magento\SalesSequence\Model\Builder->create() at /app/code/{{vendor}}/{{module}}/Setup/InstallData.php:86
. So in this file there is the creation of data into the DB tables, and when it calls create()
at some point in there, there is an error. There is a bit of a rabbit hole to follow to get to the end of why the error was hit, and i wont post it here.
But the fix for it is to have the store area set in this offending file with this suggestion here.
public function __construct(
\Magento\Framework\App\State $state
) {
$state->setAreaCode('frontend'); // or 'adminhtml', depending on your needs
}
In the case of this file, there was already a __construct(), so i just had to add in the code and the module compiled fine. It would seem that there are a lot of differnet ways that Magento will compile, and when using the CLI, the module developers have to careful to make sure that the area is set when calling any method that might depend on it. What all those methods are.........the world may never know........
setup:upgrade
with-vvv
option. It should show you the back trace, which should help identify the extension's classes involved.