mawaqit / home-assistant

Mawaqit integration - salat time and nearest mosque - in Home Assistant
54 stars 15 forks source link

Error installation Mawaqit #29

Closed youssef59600 closed 1 year ago

youssef59600 commented 1 year ago

Hello,

I tried to reinstall mawaqit on my homeassistant and got this error when I choose my masjid :

Logger: aiohttp.server Source: custom_components/mawaqit/mawaqit.py:154 Integration: Mawaqit First occurred: 4 avril 2023 à 10:36:12 (3 occurrences) Last logged: 13:56:33

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 234, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/mawaqit/config_flow.py", line 134, in async_step_mosques db = await self.fetch_prayer_times( File "/config/custom_components/mawaqit/config_flow.py", line 253, in fetch_prayer_times db = await client.fetch_prayer_times() File "/config/custom_components/mawaqit/mawaqit.py", line 154, in fetch_prayer_times raise NotAuthenticatedException custom_components.mawaqit.mawaqit.NotAuthenticatedException

hajtux commented 1 year ago

Salamoalaykom Youssef,

Did you try with the version v2 ? You can get it from the branches. A lot of errors are fixed in.

Regards, Rachid

youssef59600 commented 1 year ago

Hello Rachid,

Thank you for your assistance. Yes I tried with the V2 and got the error provided. It was working well before the last update of core HASS.

Rgds,

Le mer. 5 avr. 2023 à 15:17, hajtux @.***> a écrit :

Salamoalaykom Youssef,

Did you try with the version v2 ? You can get it from the branches. A lot of errors are fixed in.

Regards, Rachid

— Reply to this email directly, view it on GitHub https://github.com/mawaqit/home-assistant/issues/29#issuecomment-1497472552, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQDR4XYY6TV7HPCCTL6ZRN3W7VWIBANCNFSM6AAAAAAWT7IVC4 . You are receiving this because you authored the thread.Message ID: @.***>

hajtux commented 1 year ago

When you Uninstall mawaqit to reinstall it again, did you restart your Hass between the two actions? If not, maybe try this. I am using the last Hass core version and I do not have this error.

Tell me know, I will try to reinstall mine, if you still have the problem, to see if I will get the same error.

Regards Rachid

youssef59600 commented 1 year ago

Hello,

I did the test with a reboot, and installation. Now I have an other error in log :

Cette erreur provient d'une intégration personnalisée

Logger: homeassistant.config_entries Source: custom_components/mawaqit/init.py:286 Integration: mawaqit First occurred: 07:33:13 (1 occurrences) Last logged: 07:33:13

Error setting up entry Mawaqit for mawaqit_prayer_times Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.10/site-packages/simplejson/init.py", line 525, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 372, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 402, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/mawaqit/init.py", line 285, in async_setup await self.hass.async_add_executor_job(self.get_new_prayer_times) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/mawaqit/init.py", line 190, in get_new_prayer_times n = text_file.write(str(calc.fetch_prayer_times())) File "/usr/local/lib/python3.10/site-packages/mawaqit_times_calculator/pray_times_calculator.py", line 94, in fetch_prayer_times s1 = response.json()["times"][0] File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/mawaqit/init.py", line 72, in async_setup_entry if not await client.async_setup(): File "/config/custom_components/mawaqit/init.py", line 286, in async_setup except (exceptions.InvalidResponseError, ConnError) as err: NameError: name 'exceptions' is not defined

and also :

Logger: homeassistant.helpers.integration_platform Source: loader.py:796 First occurred: 07:33:13 (8 occurrences) Last logged: 07:33:46

Unexpected error importing mawaqit_prayer_times/system_health.py Unexpected error importing mawaqit_prayer_times/media_source.py Unexpected error importing mawaqit_prayer_times/logbook.py Unexpected error importing mawaqit_prayer_times/cast.py Unexpected error importing mawaqit_prayer_times/hardware.py Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 50, in _async_process_single_integration_platform_component platform = integration.get_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 779, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 796, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'custom_components.mawaqit.diagnostics'

Thank you very much for your help and assistance on the resolution of this error.

Rgds,

Le mer. 5 avr. 2023 à 17:17, hajtux @.***> a écrit :

When you Uninstall mawaqit to reinstall it again, did you restart your Hass between the two actions? If not, maybe try this. I am using the last Hass core version and I do not have this error.

Tell me know, I will try to reinstall mine, if you still have the problem, to see if I will get the same error.

Regards Rachid

— Reply to this email directly, view it on GitHub https://github.com/mawaqit/home-assistant/issues/29#issuecomment-1497667013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQDR4X4YXOQW6VPLGSPGE4DW7WEIPANCNFSM6AAAAAAWT7IVC4 . You are receiving this because you authored the thread.Message ID: @.***>

youssef59600 commented 1 year ago

version of Homeassistant :

Home Assistant 2023.4.0 Supervisor 2023.04.0 Operating System 9.5

hajtux commented 1 year ago

Could you please paste here the content of the file custom_components/mawaqit/manifest.json ?

Regards, Rachid

youssef59600 commented 1 year ago

Hello,

please find below the content of manifest.json :

[image: image.png]

Rgds,

Le ven. 7 avr. 2023 à 23:36, hajtux @.***> a écrit :

Could you please paste here the content of the file custom_components/mawaqit/manifest.json ?

Regards, Rachid

— Reply to this email directly, view it on GitHub https://github.com/mawaqit/home-assistant/issues/29#issuecomment-1500665848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQDR4XZGJ3VLQNFEPXCMG5DXACCG7ANCNFSM6AAAAAAWT7IVC4 . You are receiving this because you authored the thread.Message ID: @.***>

youssef59600 commented 1 year ago

{ "domain": "mawaqit_prayer_times", "name": "Mawaqit Prayer Times", "documentation": "https://github.com/mawaqit/home-assistant", "requirements": ["mawaqit_times_calculator>=0.0.4","pymysql"], "codeowners": ["@mawaqit"], "config_flow": true, "iot_class": "cloud_polling", "version": "2.0.0" }

hajtux commented 1 year ago

Salamoalaykom,

Your manifest is not good. For me you do not use the last update of v2 of Mawaqit integration.

Here is the expected content : { "domain": "mawaqit", "name": "Mawaqit", "documentation": "https://www.home-assistant.io/integrations/mawaqit_prayer_times", "requirements": [], "codeowners": ["@mawaqit"], "config_flow": true, "iot_class": "cloud_polling", "version": "2.0.0" }

You will notice that you do not have the same value of the requirements field.

The easiest way to resolve this behavior is to:

I hope this helps you!

Regards, Rachid

youssef59600 commented 1 year ago

Alikoum Salam,

Thank you for your assistance. I did the installation with the version 2, first uninstall the current version with reboot, and still got an error. Please find bellow the manifest.json file :

{ "domain": "mawaqit", "name": "Mawaqit", "documentation": "https://www.home-assistant.io/integrations/mawaqit_prayer_times", "requirements": [], "codeowners": ["@mawaqit"], "config_flow": true, "iot_class": "cloud_polling", "version": "2.0.0" }

content of the error logs :

Cette erreur provient d'une intégration personnalisée

Logger: aiohttp.server Source: custom_components/mawaqit/mawaqit.py:154 Integration: Mawaqit First occurred: 05:52:48 (1 occurrences) Last logged: 05:52:48

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/mawaqit/config_flow.py", line 134, in async_step_mosques db = await self.fetch_prayer_times( File "/config/custom_components/mawaqit/config_flow.py", line 253, in fetch_prayer_times db = await client.fetch_prayer_times() File "/config/custom_components/mawaqit/mawaqit.py", line 154, in fetch_prayer_times raise NotAuthenticatedException custom_components.mawaqit.mawaqit.NotAuthenticatedException


Logger: homeassistant Source: runner.py:179 First occurred: 05:52:48 (2 occurrences) Last logged: 05:52:48

Error doing job: Unclosed client session Error doing job: Unclosed connector

hajtux commented 1 year ago

Salamoalaykom,

You get this error after choosing your mosque during the installation of Mawaqit, right ? Could you choose another mosque in the list to check if it is not related only to one of them?

I reinstall mine several times without any problem. Tell me know please.

Rachid

youssef59600 commented 1 year ago

Alikoum Salam,

Yes indeed the error is just after choosing the mosque. I tried with an other mosque and same issue.

I changed the account (use account of an other mosquee) and then it is working, seem that something is wrong with my personal account ?

Thk you very much for your help and assistance.

Have a nice day and Ramadan Kareem Mubarak.