[GH-ISSUE #288] Cannot configure the gateway #65

Open
opened 2026-02-26 05:32:48 +03:00 by kerem · 6 comments
Owner

Originally created by @renal31 on GitHub (Oct 26, 2019).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/288

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

Originally created by @renal31 on GitHub (Oct 26, 2019). Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/288 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
Author
Owner

@ChristophWurst commented on GitHub (Nov 12, 2019):

Were you asked any questions? It should actually ask for a username. But that is somehow set to null.

<!-- gh-comment-id:552920138 --> @ChristophWurst commented on GitHub (Nov 12, 2019): Were you asked any questions? It should actually ask for a username. But that is somehow set to `null`.
Author
Owner

@JonasOelke commented on GitHub (Apr 13, 2020):

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

<!-- gh-comment-id:613112435 --> @JonasOelke commented on GitHub (Apr 13, 2020): 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
Author
Owner

@JonasOelke commented on GitHub (Apr 26, 2020):

@ChristophWurst Do you have any idea on this?

<!-- gh-comment-id:619577036 --> @JonasOelke commented on GitHub (Apr 26, 2020): @ChristophWurst Do you have any idea on this?
Author
Owner

@ChristophWurst commented on GitHub (Apr 27, 2020):

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.

<!-- gh-comment-id:619782000 --> @ChristophWurst commented on GitHub (Apr 27, 2020): > 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.
Author
Owner

@ChristophWurst commented on GitHub (Apr 27, 2020):

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.

<!-- gh-comment-id:619782354 --> @ChristophWurst commented on GitHub (Apr 27, 2020): > 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.
Author
Owner

@ChristophWurst commented on GitHub (Apr 27, 2020):

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.

<!-- gh-comment-id:619782904 --> @ChristophWurst commented on GitHub (Apr 27, 2020): 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/twofactor_gateway-nextcloud#65
No description provided.