String could not be parsed as XML
The same as in https://github.com/j-guyon/CommandSchedulerBundle/issues/113
php bin/console list --format=xml - dont throw error, but i still get String could not be parsed as XML
@divined Do you have a __construct function in one of your commands where you do something else than dependency injection? This was the error cause for me ;)
I don't have custom commands (
I've got same error with snc/redis-bundle enabled in version 2 because it used ContainerAwareCommand in SF4.3 wich throw exception. Solved by updating this package.
If you have an error, try searching "ContainerAwareCommand" with vscode in vendors folder (don't forgot to add an * to included files to search in any folder)
I have the same error. In my case it is Monolog that is causing this issue.
It writes DEBUG messages to php://memory when the list command is ran, and thus the stream is not solely XML.
I solved it by adding an ugly line of code to the CommandParser on line 76:
$xml = substr($xml, strpos($xml, '<?xml'));
I have the same issue (Symfony 4.4), the XML passed into extractCommandsFromXML is
11:35:40 DEBUG [snc_redis] Executing command "GET domain_doctrine[App\Entity\DomainStatistic$CLASSMETADATA][1]"
[
"tags" => [
"domain"
],
"url" => "/command-scheduler/detail/new",
"ip" => "192.168.33.1",
"http_method" => "GET",
"server" => "domain.dev",
"referrer" => "https://domain.dev/command-scheduler/list"
]
<?xml version="1.0" encoding="UTF-8"?>
When I checked the monolg config for dev env:
monolog:
handlers:
...
console:
type: console
process_psr_3_messages: false
channels: ['!event', '!doctrine', '!console']
Which I changed to:
monolog:
handlers:
...
console:
type: console
process_psr_3_messages: false
channels: ['console']
This fixed it!