nickv-nextcloud / talk_simple_poll

A simple chat based poll for Nextcloud Talk
GNU Affero General Public License v3.0
12 stars 3 forks source link

InvalidArgumentException - Not Working #20

Open yward opened 3 years ago

yward commented 3 years ago

The commands do not work, similar to issue #9

The commands were created correctly under www-data user, however they generate the following error:

InvalidArgumentException: Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somecode' 'SomeUsername' 'hello world yes no'

    /var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php - line 57:

    OCA\Talk\Chat\Command\ShellExecutor->wrapExec()

    /var/www/html/apps/spreed/lib/Chat/Command/Executor.php - line 208:

    OCA\Talk\Chat\Command\ShellExecutor->execShell()

    /var/www/html/apps/spreed/lib/Chat/Command/Executor.php - line 109:

    OCA\Talk\Chat\Command\Executor->execShell()

    /var/www/html/apps/spreed/lib/Chat/Command/Listener.php - line 72:

    OCA\Talk\Chat\Command\Executor->exec()

    /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php - line 251:

    OCA\Talk\Chat\Command\Listener::OCA\Talk\Chat\Command\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php - line 73:

    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()

    /var/www/html/lib/private/EventDispatcher/EventDispatcher.php - line 86:

    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()

    /var/www/html/apps/spreed/lib/Chat/ChatManager.php - line 195:

    OC\EventDispatcher\EventDispatcher->dispatch()

    /var/www/html/apps/spreed/lib/Controller/ChatController.php - line 195:

    OCA\Talk\Chat\ChatManager->sendMessage()

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 169:

    OCA\Talk\Controller\ChatController->sendMessage()

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 100:

    OC\AppFramework\Http\Dispatcher->executeController()

    /var/www/html/lib/private/AppFramework/App.php - line 152:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /var/www/html/lib/private/Route/Router.php - line 309:

    OC\AppFramework\App::main()

    /var/www/html/ocs/v1.php - line 88:

    OC\Route\Router->match()

    /var/www/html/ocs/v2.php - line 24:

    require_once("/var/www/html/ocs/v1.php")
nickvergessen commented 3 years ago

There should be something in the nextcloud.log

yward commented 3 years ago

There should be something in the nextcloud.log

I do not see anything much different from the system log, here's a sample:

parameters replaced ***"]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/ChatManager.php","line":195,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Controller/ChatController.php","line":195,"function":"sendMessage","class":"OCA\\Talk\\Chat\\ChatManager","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"sendMessage","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/ocs/v2.php","line":24,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' ''"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"R7d4h9jBbjpR7lfKXO5c","level":3,"time":"2021-01-26T13:47:57+00:00","remoteAddr":"196.132.77.61","user":"SomeUser","app":"spreed","method":"POST","url":"/ocs/v2.php/apps/spreed/api/v1/chat/somekey","message":{"Exception":"InvalidArgumentException","Message":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' 'hello world'","Code":0,"Trace":[{"file":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","line":57,"function":"wrapExec","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":208,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":109,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Listener.php","line":72,"function":"exec","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"OCA\\Talk\\Chat\\Command\\{closure}","class":"OCA\\Talk\\Chat\\Command\\Listener","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/ChatManager.php","line":195,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Controller/ChatController.php","line":195,"function":"sendMessage","class":"OCA\\Talk\\Chat\\ChatManager","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"sendMessage","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/ocs/v2.php","line":24,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' 'hello world'"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"A0audtIQa1JQxdCZJQxi","level":3,"time":"2021-01-26T13:48:15+00:00","remoteAddr":"196.132.77.61","user":"SomeUser","app":"spreed","method":"POST","url":"/ocs/v2.php/apps/spreed/api/v1/chat/somekey","message":{"Exception":"InvalidArgumentException","Message":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' 'hello world yes no'","Code":0,"Trace":[{"file":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","line":57,"function":"wrapExec","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":208,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":109,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Listener.php","line":72,"function":"exec","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"OCA\\Talk\\Chat\\Command\\{closure}","class":"OCA\\Talk\\Chat\\Command\\Listener","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/ChatManager.php","line":195,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Controller/ChatController.php","line":195,"function":"sendMessage","class":"OCA\\Talk\\Chat\\ChatManager","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"sendMessage","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/ocs/v2.php","line":24,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' 'hello world yes no'"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"hmGz0b4vpvgUDLiEc8ee","level":3,"time":"2021-01-26T14:25:07+00:00","remoteAddr":"196.132.77.61","user":"SomeUser","app":"spreed","method":"POST","url":"/ocs/v2.php/apps/spreed/api/v1/chat/somekey","message":{"Exception":"InvalidArgumentException","Message":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' 'haha \nyes\nno'","Code":0,"Trace":[{"file":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","line":57,"function":"wrapExec","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":208,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":109,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Listener.php","line":72,"function":"exec","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"OCA\\Talk\\Chat\\Command\\{closure}","class":"OCA\\Talk\\Chat\\Command\\Listener","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/ChatManager.php","line":195,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Controller/ChatController.php","line":195,"function":"sendMessage","class":"OCA\\Talk\\Chat\\ChatManager","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"sendMessage","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/ocs/v2.php","line":24,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' 'haha \nyes\nno'"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"somekeyrequestid","level":3,"time":"2021-01-26T14:25:33+00:00","remoteAddr":"196.132.77.61","user":"SomeUser","app":"spreed","method":"POST","url":"/ocs/v2.php/apps/spreed/api/v1/chat/somekey","message":{"Exception":"InvalidArgumentException","Message":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' ''","Code":0,"Trace":[{"file":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","line":57,"function":"wrapExec","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":208,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\ShellExecutor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Executor.php","line":109,"function":"execShell","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/Command/Listener.php","line":72,"function":"exec","class":"OCA\\Talk\\Chat\\Command\\Executor","type":"->"},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"OCA\\Talk\\Chat\\Command\\{closure}","class":"OCA\\Talk\\Chat\\Command\\Listener","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Chat/ChatManager.php","line":195,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/apps/spreed/lib/Controller/ChatController.php","line":195,"function":"sendMessage","class":"OCA\\Talk\\Chat\\ChatManager","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"sendMessage","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/ocs/v2.php","line":24,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somekey' 'SomeUser' ''"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
yward commented 3 years ago

Some additional info for debugging: Nextcloud version 20.0.6 All apps are the latest versions. PHP version is 7.4.7

nickvergessen commented 3 years ago

But there is no log for the occ command?

yward commented 3 years ago

these? ar/www/html/apps/spreed/lib/Chat/Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somecode' 'someuser' 'how yes no'"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}

and

Command/ShellExecutor.php","Line":71,"CustomMessage":"Chat command failed [Code: 1]: php /var/www/html/occ talk:poll 'somecode' 'someuser' 'hello world yes no'"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}