mawaqit/home-assistant

Unable to Set-Up MAWAQIT Prayer Times Integration - "Wrong login or password" Error

Closed this issue · 23 comments

I encountered an issue while trying to set up the MAWAQIT Prayer Times integration. Despite entering the correct login credentials, I keep receiving an error message indicating "Wrong login or password, please retry."

Steps to Reproduce:
Navigate to the Integrations page.
Select the MAWAQIT Prayer Times integration.
Enter the login credentials.
Click the "Submit" button.

Expected Behavior:
The integration should accept the correct login credentials and proceed with the setup process, allowing me to configure the prayer times based on the nearest mosque.

Actual Behavior:
The integration displays an error message stating "Wrong login or password, please retry," even though the credentials are correct.

Additional Information:
I have verified the login credentials on the MAWAQIT website, and they work correctly there.
This issue prevents me from completing the integration setup.
Home Assistant Version: 2024.5.4

Please let me know if you need any further information to help resolve this issue. Thank you.

Hello,

I have the same behaviour, @Moeamed could you tell if you resolved the problem ?

Thanks in advance

Hello, can you test the code that is currently in the "core-integration" branch and tell me if you have the same problem please ? @Abderrahimathome @Moeamed

Hello @moha-tah

New error with the "core-integration".

image

@Moeamed can you send me the logs when the error occurs please ?

Hello @moha-tah
Sorry, I am biginner on Github and HA. What do you mean by code that is currently in the "core-integration" branch ? I don’t found it :(

@Moeamed can you send me the logs when the error occurs please ?

Hello @moha-tah

Here are the logs when i push the button "submit" :

2024-05-29 06:35:09.494 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp_session/init.py", line 199, in factory
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 295, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 71, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mawaqit/config_flow.py", line 60, in async_step_user
valid = await self._test_credentials(username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mawaqit/config_flow.py", line 187, in _test_credentials
await client.login()
File "/usr/local/lib/python3.12/site-packages/mawaqit/mawaqit_async.py", line 137, in login
raise NotAuthenticatedException("Authentication failed. Please retry.")
mawaqit.consts.NotAuthenticatedException: Authentication failed. Please retry.
2024-05-29 06:35:09.496 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-05-29 06:35:09.496 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connector

Thanks

@Moeamed Are you sure that your account is working on mawaqit.net ? Can you retry (maybe with a new password) ?

@Abderrahimathome hello, no problem ! To have our integration I suppose that you copied the files that are currently in the "custom_components" folder, now do the exact same thing but firstly you have to choose the "core-integration" branch instead of "master".

You can change that on GitHub as I show you in the screenshot right after.
Screenshot GitHub

Please test this and tell me if you have the same problem, thanks !

Hello @moha-tah , Thank you for the update.

Following the steps you mentioned, I confirm that I am facing the same error encountered by @Moeamed :
image

Salam Alaykoum,

I am having the same issue. login is successful in mawaqit.net

Thanks and regards

@mtazix I will investigate myself on this issue :)

@mtazix Can you send me the logs when you encounter this problem please ?

Salam Mohamed,

Please find below logs obtained. I have this issue using both master and core-integration version. is the issue linked to "I'm not a robot" check during autentication ?

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: 21:43:22 (7 occurrences)
Last logged: 22:58:13

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp_session/init.py", line 199, in factory
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 295, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 71, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mawaqit/config_flow.py", line 60, in async_step_user
valid = await self._test_credentials(username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mawaqit/config_flow.py", line 187, in _test_credentials
await client.login()
File "/usr/local/lib/python3.12/site-packages/mawaqit/mawaqit_async.py", line 137, in login
raise NotAuthenticatedException("Authentication failed. Please retry.")
mawaqit.consts.NotAuthenticatedException: Authentication failed. Please retry.

@mtazix Thanks a lot ! The issue is that it works for most of the users and it doesn't for some. I'm currently seeking why...

Maybe it has to do with the account type in mawaqit? I chose i.e. "Home". I also have problems logging in.

Assalamo'alaykom,

@moha-tah : I did a test with my old Mawaqit account and like you I cannot reproduce the problem. Then, I create a new account with the same password than the first (but different email), I reproduce the problem. I also got error message stating "Wrong login or password, please retry,"
For now, I do not find what is going on but there's some things going on around there.

Tested with :
Core : 2024.6.1
Supervisor : 2024.06.0
Operating System : 12.3
Frontend : 20240605.0

Salem,
In my case, I confirm that I created my Mawaqit account in May 2024

I faced the same issue.

When trying login to API I got a server error

image

I have the same problem with 2 accounts. One created today and one created in the last 3 months (dont know when exactly sorry)

I have same problem, wrong password.

Assalamu aleykoum everyone,

I have great news to share. Firstly, the bug does not originate from our HomeAssistant plugin but rather from our API. The issue has been identified and will be resolved in our next release in nearly two weeks, inshaAllah.

I apologize for the inconvenience caused to those who have been unable to use the plugin. Thank you for your patience and understanding.

Hi, I also have this problem on the mawaqit of my mosque. It's impossible for it to connect to the maqawit server, but I can ping it. When I log in to the website, my credentials work correctly.
IMG-20240623-WA0012

Assalamu aleykoum everyone,

The bug is now fixed, sorry for the inconvenience and don't hesitate to reopen this issue if the bug reoccurs, but it shouldn't inshaAllah !