Open renal31 opened 5 years ago
Were you asked any questions? It should actually ask for a username. But that is somehow set to null
.
Hey Guys! Hope you all had a nice eastern.
I am trying to configure Telegram but I am getting the same error. I am running Nextcloud 18.0.3 and twofactor_gateway 0.15.1.
I am running nextcloud in a Docker-Container connected to a mariadb-server on the host (not dockerized). As of the nextcloud docker image the PHP-Version is 7.3.16.
This is the output of
docker exec --user www-data [container-id] php occ twofactorauth:gateway:configure telegram
Using .
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\TwoFactorGateway\Service\Gateway\Telegram\GatewayConfig::setBotToken() must be of the type string, null given, called in /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php on line 266 and defined in /var/www/html/custom_apps/twofactor_gateway/lib/Service/Gateway/Telegram/GatewayConfig.php:54
Stack trace:
#0 /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php(266): OCA\TwoFactorGateway\Service\Gateway\Telegram\GatewayConfig->setBotToken(NULL)
#1 /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php(86): OCA\TwoFactorGateway\Command\Configure->configureTelegram(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\TwoFactorGateway\Command\Configure->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/3rdparty/symfony/console/Application.php(915): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/html/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OCA\TwoFactorGateway\Command\Configure), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/lib/private/Console/Application.php(214): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/console.php(99): OC\Console\Application->run()
#8 /var/www/html/occ(11): require_once('/var/www/html/c...')
#9 {main}
Trying to configure the sms gateway outputs @renal31's error:
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\WebSmsConfig::setUser() must be of the type string, null given, called in /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php on line 124 and defined in /var/www/html/custom_apps/twofactor_gateway/lib/Service/Gateway/SMS/Provider/WebSmsConfig.php:52
Stack trace:
#0 /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php(124): OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\WebSmsConfig->setUser(NULL)
#1 /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php(83): OCA\TwoFactorGateway\Command\Configure->configureSms(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\TwoFactorGateway\Command\Configure->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/3rdparty/symfony/console/Application.php(915): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/html/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OCA\TwoFactorGateway\Command\Configure), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/lib/private/Console/Application.php(214): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/console.php(99): OC\Console\Application->run()
#8 /var/www/html/occ(11): require_once('/var/www/html/c...')
#9 {main}
It looks like that the setBotToken()-Function (or for SMS the setUSer()-Function) is called before the actual user input. Anyone having an idea why the user input could be skipped?
Best wishes, Jonas
@ChristophWurst Do you have any idea on this?
twofactor_gateway 0.15.1.
Please also try with the latest version.
I do not have much time to look into this right now, unfortunately.
It looks like that the setBotToken()-Function (or for SMS the setUSer()-Function) is called before the actual user input. Anyone having an idea why the user input could be skipped?
Look through the old tickets. This rings a bell but I don't recall what the problem was.
Oh I think it is due to Docker. The php shell does not detect an interactive prompt, hence questions can't be answered. You need to invoke the command through Docker and pipe stdin into the containerized process.
Hi,
I just installed TwoFactor Gateway v0.14.1 on nextcloud server v17.0.0. When I try to configure the SMS client, I get the following exception : `> occ twofactorauth:gateway:configure sms
An unhandled exception has been thrown: TypeError: Argument 1 passed to OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\WebSmsConfig::setUser() must be of the type string, null given, called in /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php on line 122 and defined in /var/www/html/custom_apps/twofactor_gateway/lib/Service/Gateway/SMS/Provider/WebSmsConfig.php:52 Stack trace:
0 /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php(122): OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\WebSmsConfig->setUser(NULL)
1 /var/www/html/custom_apps/twofactor_gateway/lib/Command/Configure.php(81): OCA\TwoFactorGateway\Command\Configure->configureSms(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
2 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\TwoFactorGateway\Command\Configure->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
3 /var/www/html/3rdparty/symfony/console/Application.php(908): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
4 /var/www/html/3rdparty/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(OCA\TwoFactorGateway\Command\Configure), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
5 /var/www/html/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
6 /var/www/html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
7 /var/www/html/console.php(97): OC\Console\Application->run()
8 /var/www/html/occ(11): require_once('/var/www/html/c...')
` Is this something known ?
Thanks & regards, Renaud