Support

Admin Tools

#36904 LoginGuard php exception error

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Thursday, 07 April 2022 04:43 CDT

eduwriter

Hello Nicholas

I hope you are well.

I have a problem and was hoping you can advise me what to do.

 When I logon to the backend  the backend opens, but I cannot do anything. This occurred after  upgrading LoginGuard to  version 6.0.2 on 3/31/2022. I  have not been able to fix this. I have included the Joomla and Server error messages below.

My thoughts are:

1.

Try to temporarily disable login guard  like you can do with admin tools, but I do not know how to do this.

2.

Restore the server to a time before  I upgraded LoginGuard. This would be most  logical, but I don't understand what is causing the issue so to prevent it from happening again I would not update Login Guard which in my thinking means it would be safer to remove it.  (This was not to be mean)  I know I can remove the plugin from the directory, but I am not certain what else I need to do.

I would appreciate f you could explain to me what is happening so I can avoid the issue again and how you would suggetst fixing the current problem.  

Thank you for you patience and help.

Sandor

 

 Error Message From Joomla When Logging into Backend

 Joomla\Plugin\Loginguard\Smsapi\Helper\SmsApi::setUsernamePassword(): Argument #1 ($username) must be of type string, null given, called in /home/linuxcou/public_html/plugins/loginguard/smsapi/src/Extension/Smsapi.php on line 552

 

Call Stack

Call stack # Function Location 1 () JROOT/plugins/loginguard/smsapi/src/Helper/SmsApi.php:665 2 Joomla\Plugin\Loginguard\Smsapi\Helper\SmsApi::setUsernamePassword() JROOT/plugins/loginguard/smsapi/src/Extension/Smsapi.php:552 3 Joomla\Plugin\Loginguard\Smsapi\Extension\Smsapi->initialiseApiHelper() JROOT/plugins/loginguard/smsapi/src/Extension/Smsapi.php:87 4 Joomla\Plugin\Loginguard\Smsapi\Extension\Smsapi->__construct() JROOT/plugins/loginguard/smsapi/services/provider.php:35 5 Joomla\DI\ServiceProviderInterface@anonymous/home/linuxcou/public_html/plugins/loginguard/smsapi/services/provider.php:17$23->{closure}() JROOT/libraries/vendor/joomla/di/src/ContainerResource.php:182 6 Joomla\DI\ContainerResource->getInstance() JROOT/libraries/vendor/joomla/di/src/Container.php:96 7 Joomla\DI\Container->get() JROOT/libraries/src/Extension/ExtensionManagerTrait.php:177 8 Joomla\CMS\Application\CMSApplication->loadExtension() JROOT/libraries/src/Extension/ExtensionManagerTrait.php:94 9 Joomla\CMS\Application\CMSApplication->bootPlugin() JROOT/libraries/src/Plugin/PluginHelper.php:236 10 Joomla\CMS\Plugin\PluginHelper::import() JROOT/libraries/src/Plugin/PluginHelper.php:194 11 Joomla\CMS\Plugin\PluginHelper::importPlugin() JROOT/administrator/components/com_loginguard/src/Helper/Tfa.php:54 12 Akeeba\Component\LoginGuard\Administrator\Helper\Tfa::getTfaMethods() JROOT/plugins/system/loginguard/src/Extension/LoginGuard.php:311 13 Joomla\Plugin\System\Loginguard\Extension\LoginGuard->needsTFA() JROOT/plugins/system/loginguard/src/Extension/LoginGuard.php:487 14 Joomla\Plugin\System\Loginguard\Extension\LoginGuard->willNeedRedirect() JROOT/plugins/system/loginguard/src/Extension/LoginGuard.php:124 15 Joomla\Plugin\System\Loginguard\Extension\LoginGuard->onAfterRoute() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486 16 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111 17 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/libraries/src/Application/AdministratorApplication.php:547 18 Joomla\CMS\Application\AdministratorApplication->route() JROOT/libraries/src/Application/AdministratorApplication.php:171 19 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:278 20 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:63 21 require_once() Server Error Messages

A PHP Exception occurred on your site. Here you can find the stack trace:

Exception Type: TypeError
File: /home/linuxcou/public_html/plugins/loginguard/smsapi/src/Helper/SmsApi.php
Line: 665
Message: Joomla\Plugin\Loginguard\Smsapi\Helper\SmsApi::setUsernamePassword(): Argument #1 ($username) must be of type string, null given, called in /home/linuxcou/public_html/plugins/loginguard/smsapi/src/Extension/Smsapi.php on line 552

#0 /home/linuxcou/public_html/plugins/loginguard/smsapi/src/Extension/Smsapi.php(552): Joomla\Plugin\Loginguard\Smsapi\Helper\SmsApi::setUsernamePassword()
#1 /home/linuxcou/public_html/plugins/loginguard/smsapi/src/Extension/Smsapi.php(87): Joomla\Plugin\Loginguard\Smsapi\Extension\Smsapi->initialiseApiHelper()
#2 /home/linuxcou/public_html/plugins/loginguard/smsapi/services/provider.php(35): Joomla\Plugin\Loginguard\Smsapi\Extension\Smsapi->__construct()
#3 /home/linuxcou/public_html/libraries/vendor/joomla/di/src/ContainerResource.php(182): Joomla\DI\ServiceProviderInterface@anonymous->{closure}()
#4 /home/linuxcou/public_html/libraries/vendor/joomla/di/src/Container.php(96): Joomla\DI\ContainerResource->getInstance()
#5 /home/linuxcou/public_html/libraries/src/Extension/ExtensionManagerTrait.php(177): Joomla\DI\Container->get()
#6 /home/linuxcou/public_html/libraries/src/Extension/ExtensionManagerTrait.php(94): Joomla\CMS\Application\CMSApplication->loadExtension()
#7 /home/linuxcou/public_html/libraries/src/Plugin/PluginHelper.php(236): Joomla\CMS\Application\CMSApplication->bootPlugin()
#8 /home/linuxcou/public_html/libraries/src/Plugin/PluginHelper.php(194): Joomla\CMS\Plugin\PluginHelper::import()
#9 /home/linuxcou/public_html/administrator/components/com_loginguard/src/Helper/Tfa.php(54): Joomla\CMS\Plugin\PluginHelper::importPlugin()
#10 /home/linuxcou/public_html/plugins/system/loginguard/src/Extension/LoginGuard.php(311): Akeeba\Component\LoginGuard\Administrator\Helper\Tfa::getTfaMethods()
#11 /home/linuxcou/public_html/plugins/system/loginguard/src/Extension/LoginGuard.php(487): Joomla\Plugin\System\Loginguard\Extension\LoginGuard->needsTFA()
#12 /home/linuxcou/public_html/plugins/system/loginguard/src/Extension/LoginGuard.php(124): Joomla\Plugin\System\Loginguard\Extension\LoginGuard->willNeedRedirect()
#13 /home/linuxcou/public_html/libraries/vendor/joomla/event/src/Dispatcher.php(486): Joomla\Plugin\System\Loginguard\Extension\LoginGuard->onAfterRoute()
#14 /home/linuxcou/public_html/libraries/src/Application/EventAware.php(111): Joomla\Event\Dispatcher->dispatch()
#15 /home/linuxcou/public_html/libraries/src/Application/AdministratorApplication.php(547): Joomla\CMS\Application\WebApplication->triggerEvent()
#16 /home/linuxcou/public_html/libraries/src/Application/AdministratorApplication.php(171): Joomla\CMS\Application\AdministratorApplication->route()
#17 /home/linuxcou/public_html/libraries/src/Application/CMSApplication.php(278): Joomla\CMS\Application\AdministratorApplication->doExecute()
#18 /home/linuxcou/public_html/administrator/includes/app.php(63): Joomla\CMS\Application\CMSApplication->execute()
#19 /home/linuxcou/public_html/administrator/index.php(32): require_once('/home/linuxcou/...')
#20 {main}

Request information
GET variables

Array
(
[X8Oy9mcsn] =>
)

POST variables

Array
(
)

COOKIE variables

Array
(
[2e360ccf0e161efaa35ef1cae167e12b] => voi0vtidf432e13d7e0hnbhj8n
[admintools_adminaccess_7410154db402462034bf14d5a06fbfed] => Ly1tUrb9b2ypXofTBQLMe2NdUTvgPpuS.o56dxnBrIPHKm04yNAmq
)

REQUEST variables

Array
(
[X8Oy9mcsn] =>
)

SERVER variables

Array
(
[PATH] => /usr/local/bin:/bin:/usr/bin
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.9
[HTTP_COOKIE] => 2e360ccf0e161efaa35ef1cae167e12b=voi0vtidf432e13d7e0hnbhj8n; admintools_adminaccess_7410154db402462034bf14d5a06fbfed=Ly1tUrb9b2ypXofTBQLMe2NdUTvgPpuS.o56dxnBrIPHKm04yNAmq
[HTTP_HOST] => www.linuxcourseware.com
[HTTP_USER_AGENT] => Mozilla/5.0 (Linux; Android 11; moto g power (2021) Build/RZBS31.Q2-143-27-7; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Mobile Safari/537.36
[HTTP_UPGRADE_INSECURE_REQUESTS] => 1
[HTTP_X_REQUESTED_WITH] => com.iliumsoft.android.ewallet.rw
[HTTP_SEC_FETCH_SITE] => none
[HTTP_SEC_FETCH_MODE] => navigate
[HTTP_SEC_FETCH_USER] => ?1
[HTTP_SEC_FETCH_DEST] => document
[HTTP_X_HTTPS] => 1
[DOCUMENT_ROOT] => /home/linuxcou/public_html
[REMOTE_ADDR] => 24.105.243.40
[REMOTE_PORT] => 38878
[SERVER_ADDR] => 66.198.240.33
[SERVER_NAME] => www.linuxcourseware.com
[SERVER_ADMIN] => [email protected]
[SERVER_PORT] => 443
[REQUEST_SCHEME] => https
[REQUEST_URI] => /administrator/?X8Oy9mcsn
[HTTPS] => on
[HTTP_AUTHORIZATION] =>
[X_SPDY] => HTTP3
[SSL_PROTOCOL] => QUIC
[SSL_CIPHER] => TLS_AES_128_GCM_SHA256
[SSL_CIPHER_USEKEYSIZE] => 128
[SSL_CIPHER_ALGKEYSIZE] => 128
[SCRIPT_FILENAME] => /home/linuxcou/public_html/administrator/index.php
[QUERY_STRING] => X8Oy9mcsn
[SCRIPT_URI] => https://www.linuxcourseware.com/administrator/
[SCRIPT_URL] => /administrator/
[SCRIPT_NAME] => /administrator/index.php
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SOFTWARE] => LiteSpeed
[REQUEST_METHOD] => GET
[X-LSCACHE] => on
[PHP_SELF] => /administrator/index.php
[REQUEST_TIME_FLOAT] => 1649273788.3667
[REQUEST_TIME] => 1649273788

 

 

nicholas
Akeeba Staff
Manager

OK, the problem is that you had enabled the Send code by text plugin without having configured it. Here's what to do.

Rename the folder plugins/system/loginguard/smsapi/services to services.bak

Log into your site's backend

Go to System, Plugins

Disable the “LoginGuard - Authentication Code by SMS (using SMSAPI.com)” plugin

Rename the folder plugins/system/loginguard/smsapi/services.bak back to services

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

eduwriter

The directory doesn't exist.

 

There are 2 directories under /plugins/system/loginguard

services and src

 

eduwriter

Nicholas

I found the directory under plugins//ogin guard and was able to fix the error. 

After looking at the log files I saw where it pointed to smsapi, but I would have never been able to figure out how to fix it.

To be honest I don't remember enabling those features, and I could not find where I change them on my change log. Anyway I'm glad it's fixed

Please close the ticket after you've read this.

Thank you for your help.

Stay well,

Sandir

 

 

 

 

 

 

 

 

nicholas
Akeeba Staff
Manager

I think you might have come from a very old version of LoginGuard which at the time enabled all optional plugins upon installation. The SMSAPI plugin was inert (wouldn't show any options) if it wasn't configured properly so you never noticed the plugin was actually enabled. It's a good catch, though, I will add some extra error-handling in the upcoming version to address migration from use cases like yours :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!