Git-Package-Management icon indicating copy to clipboard operation
Git-Package-Management copied to clipboard

Unable to add package containing resources

Open smaddock opened this issue 5 years ago • 2 comments

If I run the following command from a snippet, it executes just fine: $res = $this->modx->runProcessor('resource/create', $resource);

However when that command is run from GPM as part of adding a package, with the same options in $resource, it breaks. Unfortunately no errors are logged anywhere other than the Manager UI displaying "Access denied" error, but through a manual stack trace I've traced it down to:

GitPackageManagementCreateProcessor->createResource: 727 "runProcessor" never returns
modX->runProcessor:1764 "run" never returns
modProcessor->run: 177 "process" never returns
modObjectCreateProcessor->process: 680 "cleanup" never returns
modResourceCreateProcessor->cleanup: 206 "success" never returns
modProcessor->success: 105 "success" never returns
modError->success: 272 "process" never returns
modError->process: 142 "resetLogging" never returns
modRegistry->resetLogging: 192 "setLogTarget" never returns
xPDO->setLogTarget: 1988 setting "$this->logTarget" fails

The value trying to be set is: Array => {"target":"FILE","options":{"filename":"error.log"}}

Based on the Manager popup error, I’m guessing the file path is not set correctly when the processor is called from GPM, but I don’t know how to see what it is set to or how to make sure it’s set correctly.

smaddock avatar Mar 23 '20 18:03 smaddock

Note this occurs when following the instructions at http://theboxer.github.io/Git-Package-Management/config/package/#resources ... when the resources array is included as part of the package JSON object in config.json, GitPackageManagementCreateProcessor->createResource calls runProcessor as noted above.

smaddock avatar Mar 23 '20 18:03 smaddock

To further clarify, the first resource is created, before the failure documented above, which halts the install script and prevents any additional resources from being created.

smaddock avatar Mar 23 '20 21:03 smaddock