greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
1k stars 85 forks source link

[Bug] Failed to connect. Check credentials #739

Open Miaoerr opened 2 hours ago

Miaoerr commented 2 hours ago

Home Assistant Version

2024.11.1

Bambu Lab Integration Version

v2.0.36

Describe the bug

When trying to connect to bambu lab cloud (China) I got the message "A verification code is required.", Then I received the text verification code and filled in the input box, Then I get the message, "Failed to connect. Check credentials". I don't know how to enable debug log with a not intsalled integration, but in general log I found this entry:

此错误来自自定义集成。

日志记录器: custom_components.bambu_lab 来源: custom_components/bambu_lab/config_flow.py:193 集成: Bambu Lab (文档, 问题) 首次出现: 10:05:01 (1 次总计出现) 上次记录: 10:05:01

Failed to connect with error code ('list index out of range',)

I think I'm still being intercepted by cloudflare capTCHA, but the previous issue has been closed.

To Reproduce

Setup Integrations Add Integration Select Bambu Lab Select Cloud Select China Enter Phone Number and Password Click Login Enter Verification Code Click Login

Expected Behaviour

Successful connection to Bambu Lab Cloud.

What device are you using?

P1S

Diagnostic Output

Not possible, first time installation

Log Extracts

此错误来自自定义集成。

日志记录器: custom_components.bambu_lab
来源: custom_components/bambu_lab/config_flow.py:193
集成: Bambu Lab (文档, 问题)
首次出现: 10:05:01 (1 次总计出现)
上次记录: 10:05:01

Failed to connect with error code ('list index out of range',)

Other Information

No response

Miaoerr commented 2 hours ago

I have used v2.0.34, v2.0.35, v2.0.36, v2.0.37-dev1, but they all failed to log in successfully.

AdrianGarside commented 2 hours ago

Soes 2.0.37-dev1 give different error output?

AdrianGarside commented 2 hours ago

Add this to your configuration.yaml to have debug logs during initial setup:


  default: info
  logs:
    custom_components.bambu_lab: debug
Miaoerr commented 1 hour ago

After I set up logger, this is the log for v2.0.37-dev1:

此错误来自自定义集成。

日志记录器: custom_components.bambu_lab.pybambu 来源: custom_components/bambu_lab/pybambu/bambu_cloud.py:135 集成: Bambu Lab (文档, 问题) 首次出现: 10:45:07 (1 次总计出现) 上次记录: 10:45:07

Login attempt failed with error code: 400

此错误来自自定义集成。

日志记录器: custom_components.bambu_lab 来源: custom_components/bambu_lab/config_flow.py:187 集成: Bambu Lab (文档, 问题) 首次出现: 10:45:07 (1 次总计出现) 上次记录: 10:45:07

Failed to connect with error code (400, '{"code":2,"error":"Invalid or already taken"}')

This is the log for v2.0.36:

此错误来自自定义集成。

日志记录器: custom_components.bambu_lab 来源: custom_components/bambu_lab/config_flow.py:193 集成: Bambu Lab (文档, 问题) 首次出现: 10:47:51 (1 次总计出现) 上次记录: 10:47:51

Failed to connect with error code ('Failed to perform, curl: (6) Could not resolve host: api.bambulab.cn. See https://curl.se/libcurl/c/libcurl-errors.html first for more details.',)

But I used my Home Assistant network to access api.bambulab.cn and it seems to be accessible normally, but it shows:

d28f3b430328:/config# curl api.bambulab.cn
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>