sockless-coding / panasonic_cc

Panasonic Comfort Cloud - Home Assistant Component
MIT License
171 stars 38 forks source link

Error 500 in loading integration #147

Closed amirandola closed 10 months ago

amirandola commented 11 months ago

Hello, I have this error in loading integration. I don't know when start to happen, in winter I use CC not very often ...

ERROR (MainThread) [homeassistant.config_entries] Error setting up entry for panasonic_cc Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/init.py", line 79, in async_setup_entry devices = await hass.async_add_executor_job(api.get_devices) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 207, in get_devices self.login() File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login self._create_token() File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token raise ResponseError(response.status_code, response.text) custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 500 - Data: {"code":5001,"message":"DB system error due to db system"}

kongjudas commented 11 months ago

I got "Too many requests" earlier today, which looks to be the same issue. Seems like the API is changed.

amirandola commented 11 months ago

Same error reinstalling the integration. It can be the same problem of the prevoius issue ...

Auka84 commented 11 months ago

Same error reinstalling the integration. It can be the same problem of the prevoius issue ...

does it work after reinstalling the integration ?

amirandola commented 11 months ago

Same error reinstalling the integration. It can be the same problem of the prevoius issue ...

does it work after reinstalling the integration ?

No no, always 500 error

clostermannshof commented 11 months ago

Same problem here, reinstall didn't help, going back to another version didn't help.

2023-12-11 14:42:31.964 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry  for panasonic_cc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/__init__.py", line 79, in async_setup_entry
    devices = await hass.async_add_executor_job(api.get_devices)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 207, in get_devices
    self.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 500 - Data: {"code":5001,"message":"DB system error due to db system"}
dardour7 commented 11 months ago

Hi, I have the same problem since today

image

image

jema24 commented 11 months ago

Hi, same issue here. Error code 5001. Noticed after HA core&supervisor upgrade, rolled back HA core and spun up separate HA instance with earliy version nothing worked. Always same error.

sockless-coding commented 11 months ago

Hi, Since the error code from the Panasonic API is 500 with sub code 5001: DB system error due to db system The error is located on Panasonic's end, so we have to wait until they resolve this issue.

mkz212 commented 11 months ago

@sockless-coding Are you sure they won't block APIs for plugins / apps other than their own?

sockless-coding commented 11 months ago

@mkz212 of course they will do all in their power to prevent any other system from using their API (it's a non-public API). That's why the integration breaks when they do major updates to the client and backend, but it's usually not that hard to make the changes to the integration so it mimics the app.

mkz212 commented 11 months ago

@sockless-coding

I have always wondered how to detect such changes in the API? E.g. Now do you see if there are any changes?

P.S.: I have Gree air conditioning in another house and there the plug has not been updated for over 2 years and everything works. In addition, locally, without the Internet. And in Panasonic there is still something...

kenchy commented 11 months ago

So assuming they haven't done anything to try and stop this integration.....

  1. They changed the API in September to lock accounts after a number of requests that generate errors.
  2. Their servers go down and generate errors.
  3. The accounts lock.
  4. We have to wait for the accounts to unlock?
mkz212 commented 11 months ago

So assuming they haven't done anything to try and stop this integration.....

  1. They changed the API in September to lock accounts after a number of requests that generate errors.
  2. Their servers go down and generate errors.
  3. The accounts lock.
  4. We have to wait for the accounts to unlock?
  1. These blocks have been before (before September).
  2. For me, such a block was always removed after midnight (not after 24 hours).
amirandola commented 11 months ago

So assuming they haven't done anything to try and stop this integration.....

  1. They changed the API in September to lock accounts after a number of requests that generate errors.
  2. Their servers go down and generate errors.
  3. The accounts lock.
  4. We have to wait for the accounts to unlock?

I try with new account, and it doesn't work. It's not a locked account problem

mkz212 commented 11 months ago

So assuming they haven't done anything to try and stop this integration.....

  1. They changed the API in September to lock accounts after a number of requests that generate errors.
  2. Their servers go down and generate errors.
  3. The accounts lock.
  4. We have to wait for the accounts to unlock?

I try with new account, and it doesn't work. It's not a locked account problem

First they broke something in the login. Because of this, there was a large number of incorrect logins and account blocking.

amirandola commented 11 months ago

So assuming they haven't done anything to try and stop this integration.....

  1. They changed the API in September to lock accounts after a number of requests that generate errors.
  2. Their servers go down and generate errors.
  3. The accounts lock.
  4. We have to wait for the accounts to unlock?

I try with new account, and it doesn't work. It's not a locked account problem

First they broke something in the login. Because of this, there was a large number of incorrect logins and account blocking.

Account is not blocked. If I try it on App, it works perfectly

erikgroentje commented 11 months ago

Same for me😫

erikgroentje commented 11 months ago

Same for me😫

Openend the Panasonic app this morning. Had work my way through some EULA stuff and afterwards I reloaded the integration and it works again for me. Don't know if the EULA stuff was the issue but it works again.

kenchy commented 11 months ago

Can confirm once I accepted the 2 or 3 new EULA In the account used by HA it started to work again.

mlpplm commented 11 months ago

Where can you find the new EULA? If I open the mobile app (android) there is no such item.

teamsuperpanda commented 11 months ago

Accepted the EULAs (app version 1.19.0) Reloaded the integration and even restarted HA with no luck.

ahrendt commented 11 months ago

I was logged into the app all the time, didn't accept anything but this morning it still worked in HA after reloading the Integration. Nevertheless I'm going the ESP path in the near future as I want to have a 24/7/365 reliable system.

dardour7 commented 11 months ago

Hi, This morning I just reloaded the Panasonic integration on HA and it works again. hoping it holds

mkz212 commented 11 months ago

@dardour7 Did you change anything? I use a different plugin (for Homebridge) and the same errors and results. Now after Panasonic unlock the 24 h ban, I can log in to the Panasonic application but the plugin still does not log in.

dardour7 commented 11 months ago

@mkz212

no I didn't change anything, I just reloaded cf screeshot integration

image

yesterday when I did this, it didn't work

mkz212 commented 11 months ago

@dardour7 Can you provide response from API? From logs?

AndreasAtHome commented 11 months ago

I have:

Still get the 500 error as mentioned before custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 500 - Data: {"code":5001,"message":"DB system error due to db system"}

jumpinf00l commented 11 months ago

@mkz212

no I didn't change anything, I just reloaded cf screeshot integration

image

yesterday when I did this, it didn't work

Also what geographic region did you select when setting up the Panasonic ID account? I wonder whether the issue only affects accounts in certain regions

Auka84 commented 11 months ago

Are there a choice of region ? When I created my account i hadn't any choice for a specific region. When i did too many reboot of HA some week ago, my account was banned for 24h, I called the panasonic support in France (because no support number in belgium) and they didn't find any account with my email. They escalated the issue and they told me my panasonic cloud account is linked to Japan. Btw, all is in french in my app and work perfect. I don't find any information in my account about a region

I created my account directly in the app for Iphone. @jumpinf00l you created also the account in the app ?

mkz212 commented 11 months ago

Here you can check country: https://csapl.pcpf.panasonic.com/Account/ (Click update account info and login)

I have country: Poland.

Panasonic app working. Plugin: not working

Auka84 commented 11 months ago

Thx @mkz212 I have well belgium. Strange they told me I have Japan :p

mkz212 commented 11 months ago

Thx @mkz212 I have well belgium. Strange they told me I have Japan :p

But does the plug work for you or not?

Auka84 commented 11 months ago

Yes It's working back since this morning. Just activate the integration back and reload it

mkz212 commented 11 months ago

Yes It's working back since this morning. Just activate the integration back and reload it

Can you provide more info? Maybe api response from logs?

bakoscsaba commented 11 months ago

App works fine for me, but in HA it still fails to set up the integration. Account country: Hungary

I tried to reload the integration, restart HA, but the issue persist.

Auka84 commented 11 months ago

did you deactivate the integration and reactivate again ? I'll check in my log

kongjudas commented 11 months ago

Got it back now, in Norway. I just reloaded the integration.

mkz212 commented 11 months ago

did you deactivate the integration and reactivate again ? I'll check in my log

I use a different plugin - not for Home Assistant, but for Homebridge. But the same errors, etc.

mkz212 commented 11 months ago

Why does it work for one users and for others not?? Do you have different versions of the plugin? Different settings? What makes you different?

jumpinf00l commented 11 months ago

Why does it work for one users and for others not?? Do you have different versions of the plugin? Different settings? What makes you different?

That’s the reason for my thought around geographic region

Region: Australia (g’day) App: working Integration: not working, error 500

mkz212 commented 11 months ago

Why does it work for one users and for others not?? Do you have different versions of the plugin? Different settings? What makes you different?

That’s the reason for my thought around geographic region

Region: Australia (g’day) App: working Integration: not working, error 500

What version of the plugin? What settings?

jumpinf00l commented 11 months ago

Why does it work for one users and for others not?? Do you have different versions of the plugin? Different settings? What makes you different?

That’s the reason for my thought around geographic region Region: Australia (g’day) App: working Integration: not working, error 500

What version of the plugin? What settings?

1.0.37, and no settings because error 500 prevents me from setting up the integration after removing it

Auka84 commented 11 months ago

it seems that in europe it's back

@mkz212 Why do you not use the HA integration, it's possible after that to integrate in homekit with homekit bridge in HA :)

verwilst commented 11 months ago

Not really, Belgium here, still same error.

fursov commented 11 months ago

And does not work for me in Finland.

jumpinf00l commented 11 months ago

@Auka84 If you do nslookup on accsmart.panasonic.com what are the IPs resolved?

I just tried creating a new account with region set to Norway and I still get error 500

mkz212 commented 11 months ago

And does not work in Poland. Only Panasonic app works.

bakoscsaba commented 11 months ago

Also fails in Hungary. Just now: custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 500 - Data: {"code":5001,"message":"DB system error due to db system"}

Auka84 commented 11 months ago

oh @verwilst I'm in belgium too and it's working btw I didn't try any reload and reactivation of the integration during 24h to be sure i'm unbanned

I also deactivate all automation that require my panasonic AC. I deactivate the integration yesterday at 7am i think and reactivate it today around 8:30. @jumpinf00l

Capture d’écran 2023-12-12 à 12 18 14

jumpinf00l commented 11 months ago

Thanks, using those IPs in DNS didn't change anything - I guess it's not region-related