You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[issue] Exakat fails to generate report - PHP Fatal Error: Uncaught Error: Return value must be instance Brightzone\GremlinDriver\mixed, array returned
#154
Open
eapostol opened this issue
Dec 6, 2021
· 2 comments
running exakat to generate sample audit php exakat.phar project -p sculpin after installing / configuring should generate a sample report in projects (name of project) folder
Current Behavior
exakat fails to generate a sample audit, file php_error.log returns the following error:
[06-Dec-2021 00:16:26 America/New_York] PHP Fatal error: Uncaught TypeError: Return value of Brightzone\GremlinDriver\RequestMessage::jsonSerialize() must be an instance of Brightzone\GremlinDriver\mixed, array returned in phar:///sample/user/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/RequestMessage.php:60
Possible Solution
Replace the jsonSerialize() method and remove the :mixed from the signature (or the equiv. if possible to 'any')
`
/**
* The json serialize method
*
* @return mixed
* */
public function jsonSerialize():mixed
{
return $this->getData();
}
`
becomes
`
/**
* The json serialize method
*/
public function jsonSerialize()
{
return $this->getData();
}
`
and repackage the .phar file
Steps to Reproduce
Follow full installation steps to install exakat for Ubuntu 20+
Follow instructions for debian/ubuntu installation with Tinkergraph 3.4.9
followed instructions from exakat documentation to install exakat. No issues encountered per se.
Caveat: Using openJDK 1.8 vs. Oracle Java JDK but that really should not be a difference in this issue afaik
Full stack trace is shown
[06-Dec-2021 00:16:26 America/New_York] PHP Fatal error: Uncaught TypeError: Return value of Brightzone\GremlinDriver\RequestMessage::jsonSerialize() must be an instance of Brightzone\GremlinDriver\mixed, array returned in phar:///x/iy/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/RequestMessage.php:60
Stack trace:
#0 phar:///home/x/exakat-ubuntu/exakat.phar/library/Exakat/Graph/Helpers/GraphsonV3.php(306): Brightzone\GremlinDriver\RequestMessage->jsonSerialize() #1 phar:///home/x/exakat/exakat.phar/library/Exakat/Graph/Helpers/GraphsonV3.php(144): Exakat\Graph\Helpers\GraphsonV3->convertObject() #2 phar:///home/x/exakat/exakat.phar/library/Exakat/Graph/Helpers/GraphsonV3.php(84): Exakat\Graph\Helpers\GraphsonV3->convert() #3 phar:///home/x/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/Message.php(189): Exakat\Graph\Helpers\GraphsonV3->serialize() #4 phar:///home/x/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/Connection.php(184): Brightzone\GremlinDriver in phar:///home/x/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/RequestMessage.php on line 60
The text was updated successfully, but these errors were encountered:
Expected Behavior
php exakat.phar project -p sculpin
after installing / configuring should generate a sample report in projects (name of project) folderCurrent Behavior
[06-Dec-2021 00:16:26 America/New_York] PHP Fatal error: Uncaught TypeError: Return value of Brightzone\GremlinDriver\RequestMessage::jsonSerialize() must be an instance of Brightzone\GremlinDriver\mixed, array returned in phar:///sample/user/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/RequestMessage.php:60
Possible Solution
Replace the jsonSerialize() method and remove the :mixed from the signature (or the equiv. if possible to 'any')
`
/**
* The json serialize method
*
* @return mixed
* */
public function jsonSerialize():mixed
{
return $this->getData();
}
`
becomes
`
/**
* The json serialize method
*/
public function jsonSerialize()
{
return $this->getData();
}
`
and repackage the .phar file
Steps to Reproduce
php exakat.phar init -p sculpin -R https://github.com/sculpin/sculpin
php exakat.phar project -p sculpin
Context (Environment)
Full stack trace is shown
[06-Dec-2021 00:16:26 America/New_York] PHP Fatal error: Uncaught TypeError: Return value of Brightzone\GremlinDriver\RequestMessage::jsonSerialize() must be an instance of Brightzone\GremlinDriver\mixed, array returned in phar:///x/iy/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/RequestMessage.php:60
Stack trace:
#0 phar:///home/x/exakat-ubuntu/exakat.phar/library/Exakat/Graph/Helpers/GraphsonV3.php(306): Brightzone\GremlinDriver\RequestMessage->jsonSerialize()
#1 phar:///home/x/exakat/exakat.phar/library/Exakat/Graph/Helpers/GraphsonV3.php(144): Exakat\Graph\Helpers\GraphsonV3->convertObject()
#2 phar:///home/x/exakat/exakat.phar/library/Exakat/Graph/Helpers/GraphsonV3.php(84): Exakat\Graph\Helpers\GraphsonV3->convert()
#3 phar:///home/x/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/Message.php(189): Exakat\Graph\Helpers\GraphsonV3->serialize()
#4 phar:///home/x/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/Connection.php(184): Brightzone\GremlinDriver in phar:///home/x/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/RequestMessage.php on line 60
The text was updated successfully, but these errors were encountered: