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

Invalid argument exception - does not work for me #9

Closed Dubidubiduu closed 4 years ago

Dubidubiduu commented 4 years ago

Simple poll for Nextcloud Talk 1.0.0 NC 17.0.2

I created the commands

 [hundekuchen@cp80 cloud]$ ./occ talk:command:add poll Poll '/home/hundekuchen/public_html/cloud/occ talk:poll {ROOM} {USER} "{ARGUMENTS_DOUBLEQUOTE_ESCAPED}"' 2 3                                            Command added

+----+-----+------+---------+------------------------------------------------------------------------------------------------+----------+---------+
| id | app | name | command | script                                                                                         | response | enabled |
+----+-----+------+---------+------------------------------------------------------------------------------------------------+----------+---------+
| 4  |     | Poll | poll    | /home/hundekuchen/public_html/cloud/occ talk:poll {ROOM} {USER} "{ARGUMENTS_DOUBLEQUOTE_ESCAPED}" | 2        | 3       |
+----+-----+------+---------+------------------------------------------------------------------------------------------------+----------+---------+

If you think your command makes sense for other users as well, feel free to share it in the following github issue:
 https://github.com/nextcloud/spreed/issues/1566
[hundekuchen@cp80 cloud]$ ./occ talk:command:add vote Poll '/home/hundekuchen/public_html/cloud/occ talk:poll:vote {ROOM} {USER} "{ARGUMENTS_DOUBLEQUOTE_ESCAPED}"' 2 3
Command added

+----+-----+------+---------+-----------------------------------------------------------------------------------------------------+----------+---------+
| id | app | name | command | script                                                                                              | response | enabled |
+----+-----+------+---------+-----------------------------------------------------------------------------------------------------+----------+---------+
| 5  |     | Poll | vote    | /home/hundekuchen/public_html/cloud/occ talk:poll:vote {ROOM} {USER} "{ARGUMENTS_DOUBLEQUOTE_ESCAPED}" | 2        | 3       |
+----+-----+------+---------+-----------------------------------------------------------------------------------------------------+----------+---------+

but when I run the command I get

Poll-bot
Beim Ausführen des Befehls ist ein Fehler aufgetreten. Bitte einen Administrator, die Protokolle zu überprüfen.

(which just states there is an error)

and this in that nextcloud error log

[spreed] Error: InvalidArgumentException: Chat command failed [Code: 1]: /home/hundekuchen/public_html/cloud/occ talk:poll '88b37h8i' 'dubidubidub' "Noch ein Test
Yes
No" at <<closure>>

 0. /home/hundekuchen/public_html/cloud/apps/spreed/lib/Chat/Command/ShellExecutor.php line 54
    OCA\Spreed\Chat\Command\ShellExecutor->wrapExec("/home/hundekuchen/ ... "")
 1. /home/hundekuchen/public_html/cloud/apps/spreed/lib/Chat/Command/Executor.php line 197
    OCA\Spreed\Chat\Command\ShellExecutor->execShell("/home/hundekuchen/ ... "", "Noch ein Test\nYes\nNo", "88b37h8i", "dubidubidub")
 2. /home/hundekuchen/public_html/cloud/apps/spreed/lib/Chat/Command/Executor.php line 91
    OCA\Spreed\Chat\Command\Executor->execShell(OCA\Spreed\Room {}, OC\Comments\Comment {}, OCA\Spreed\Model\Command {id: 4}, "Noch ein Test\nYes\nNo")
 3. /home/hundekuchen/public_html/cloud/apps/spreed/lib/Chat/Command/Listener.php line 91
    OCA\Spreed\Chat\Command\Executor->exec(OCA\Spreed\Room {}, OC\Comments\Comment {}, OCA\Spreed\Model\Command {id: 4}, "Noch ein Test\nYes\nNo")
 4. /home/hundekuchen/public_html/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 212
    OCA\Spreed\Chat\Command\Listener::OCA\Spreed\Chat\Command\{closure}("*** sensitive parameters replaced ***")
 5. /home/hundekuchen/public_html/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 44
    Symfony\Component\EventDispatcher\EventDispatcher->doDispatch([Closure {}], "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 6. /home/hundekuchen/public_html/cloud/lib/private/EventDispatcher/SymfonyAdapter.php line 59
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 7. /home/hundekuchen/public_html/cloud/apps/spreed/lib/Chat/ChatManager.php line 160
    OC\EventDispatcher\SymfonyAdapter->dispatch("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 8. /home/hundekuchen/public_html/cloud/apps/spreed/lib/Controller/ChatController.php line 173
    OCA\Spreed\Chat\ChatManager->sendMessage(OCA\Spreed\Room {}, OCA\Spreed\Participant {}, "users", "dubidubidub", "/poll Noch ein Test\nYes\nNo\n", DateTime {date:  ... "}, null)
 9. /home/hundekuchen/public_html/cloud/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\Spreed\Controller\ChatController->sendMessage("/poll Noch ein Test\nYes\nNo\n", "", 0)
10. /home/hundekuchen/public_html/cloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Spreed\Controller\ChatController {}, "sendMessage")
11. /home/hundekuchen/public_html/cloud/lib/private/AppFramework/App.php line 126
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Spreed\Controller\ChatController {}, "sendMessage")
12. /home/hundekuchen/public_html/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Spreed\\Controller\\ChatController", "sendMessage", OC\AppFramework\ ... {}, {apiVersion: "v1 ... "})
13. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({apiVersion: "v1 ... "})
14. /home/hundekuchen/public_html/cloud/lib/private/Route/Router.php line 297
    undefinedundefinedcall_user_func(OC\AppFramework\ ... {}, {apiVersion: "v1 ... "})
15. /home/hundekuchen/public_html/cloud/ocs/v1.php line 82
    OC\Route\Router->match("/ocsapp/apps/sp ... i")
16. /home/hundekuchen/public_html/cloud/ocs/v2.php line 24
    undefinedundefinedrequire_once("/home/hundekuchen/ ... p")

POST /cloud/ocs/v2.php/apps/spreed/api/v1/chat/88b37h8i
from 95.116.160.68 by dubidubidub at 2020-01-08T19:19:14+00:00
nickvergessen commented 4 years ago

I just tried 17 and 18 on the weekend and both worked fine. Maybe you are missing sudo -u www-data on your commands?

nickvergessen commented 4 years ago

Clsoing due to missing feedback