tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
574 stars 103 forks source link

Issue with Web UI fror create Token #606

Closed Holborn13200 closed 1 year ago

Holborn13200 commented 1 year ago

Hello, I have a issue for token creation with Web UI. When i set my credentials and click on "Submit" bouton, nothing happen.

My Home Assistant instance is install with Docker on Synology NAS. Has anyone encountered this problem before? Another solution exist for token management? Thanks lot for your help.

tsightler commented 1 year ago

Most likely is related this this: https://github.com/dgreif/ring/issues/1192

Holborn13200 commented 1 year ago

Most likely is related this this: dgreif/ring#1192

Hello and tanks lot for your answer but isn't the same issue. For my case, no error on the logs. Nothing happend when i click on Submit button.

tsightler commented 1 year ago

I think it is the same issue, that is the behavior that is observed with ring-mqtt.

tsightler commented 1 year ago

It is definitely the same issue. I have implemented a hackish fix in the dev branch. It seemed to work for me as I was able to reproduce the error easily enough, but if you want to give it a try and let me know, that would be great.

tsightler commented 1 year ago

Also, to be clear, testing the dev branch only requires setting the BRANCH environment option to "dev" and restarting the container and it will pull down the latest dev branch. Another user has already reported success with this change.

Daali commented 1 year ago

another affected user. Switched to BRANCH "dev" and back online. Thank you for the hackfix =)

tsightler commented 1 year ago

Version 5.2.2 has been released and includes the more correct fix from upstream. Closing.

Holborn13200 commented 1 year ago

You close this incident very quickly. I installed the latest version but nothing has changed. Same problem, nothing happens when I click on the Submit button. I don't find the origin of problem, firewall? Docker? Synology? Too bad, no solution to my problem, I uninstall. Thanks for your time.

tsightler commented 1 year ago

The incident can be reopened, it's no big deal. However, you opened an issue while completely ignoring the issue template, did not provide logs, and you only described a symptom which matched the functional description others had just started reporting at nearly the identical time, all while the web based token generator has been around for years now with nearly no reports of significant issues. Perhaps that was just incredibly bad timing, but you can't really blame me for assuming the issue is likely to be the same when you provided no other requested information.

You also asked if there were other ways to manage tokens, but this is already covered in the documentation as the Web based token generator isn't even the method recommended in the docs, the CLI based tool is.

Regardless, it doesn't really matter, I'm happy to try to assist further, or you can uninstall it and move on.

Holborn13200 commented 1 year ago

So my apologies if my answer was misinterpreted. I'm sorry again for not respecting the template for opening an incident, but apart from the symptom I have no additional informations. No error in the logs. I will try to explore other methods of acquiring the token. I apologize once again. Have a nice evening.

tsightler commented 1 year ago

It's no problem, if you would like me to reopen the issue we can investigate further. Are you absolutely sure there is no other information in the logs? Did you view it from the command line or perhaps only in Synlogy? I wonder if maybe you are only seeing stdout, but not stderr?

It's very difficult for me to understand how there could be no log message at all because the submit action immediate creates a a RingRestClient objct and check for auth, which should always fail and output at least some message.

What happend if you enter random username/password?

Let me know if you want me to re-open the issue and we can continue to investigate. I would still like to see the full log even if you believe there is nothing there.

Holborn13200 commented 1 year ago

Hello, This is a very strange case. I tested with manual docker installation and with this solution, no problem. The access to the web interface is ok and the 2FA identification is well done.
It's really only with the Home Assistant Addon Install method that I encounter the validation problem after entering the credentials. I get the messages sent (via Node Red currently, I will get them in Home Assistant). I really don't understand. Thanks.

tsightler commented 1 year ago

I don't think I fully understand what you wrote. I will point out that there is basically no difference between the Docker and Addon, they are both the identical docker image (an addon is just a Docker image with some additional metadata to describe it). There are some minor differences in how the configuration is processed, but there are no significant functional differences.

I'm also not sure what you mean by messages via Node Red, are you saying that you can see messages in Node Red from the addon but not in Home Assistant?

tsightler commented 1 year ago

I've reopened the issue for now BTW, please feel free to provide more information and I can try to help.

Holborn13200 commented 1 year ago

The facts are there, during the installation via home assistant module, the docker was well created but impossible to realize the creation of the token from Home Assitant Web UI link.

With a direct installation in Docker no problem to create the token from the WEB UI.

For Node Red it was only to test the structure of the received messages, now I recover well the information which interests me directly in home assitant.

The mystery is in the difference of behavior of the Web UI between HA Module / direct Docker.

tsightler commented 1 year ago

The facts may be there, but there is nothing on which to act on for my part. Without logs or some other way to determine the cause, I can only make crazy guesses which are not very useful. As stated above, there is literally no different between Docker and Addon, they use the identical image, thus the problem as to be in something around that.

However, the addon is the method used by 90% of ring-mqtt users, and that usage represents ~6000 installs, all of which manage to generate the token with no issues.

Unfortunately, unless you can provide logs, I'll likely be forced to simply leave it at the mystery stage.

lagge78 commented 1 year ago

Ping @tsightler

I have the same issue since today. I run the ring-mqtt addon in Homeassistant since like 2 years. Now I get the token error below. And when I try to fill in the acount login nothing happens, I never see the 2fa page. I hope the last lines in the log can help. Those lines are logged after I press submit in the webui.

2023-07-11T21:21:34.376Z ring-mqtt Failed to establish connection to Ring API using saved refresh token 2023-07-11T21:21:34.376Z ring-mqtt Failed to connect to Ring API using saved token, generate a new token using the Web UI 2023-07-11T21:21:34.376Z ring-mqtt or wait 60 seconds to automatically retry authentication using the existing token 2023-07-11T21:22:34.386Z ring-mqtt Retrying authentication with existing saved token... 2023-07-11T21:22:34.397Z ring-mqtt Attempting connection to Ring API using saved refresh token... 2023-07-11T21:22:36.550Z ring-mqtt Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens 2023-07-11T21:22:36.550Z ring-mqtt Failed to establish connection to Ring API using saved refresh token 2023-07-11T21:22:36.550Z ring-mqtt Failed to connect to Ring API using saved token, generate a new token using the Web UI 2023-07-11T21:22:36.551Z ring-mqtt or wait 60 seconds to automatically retry authentication using the existing token 2023-07-11T21:23:10.932Z ring-mqtt WARNING - Unhandled Promise Rejection 2023-07-11T21:23:10.932Z ring-mqtt TypeError: argument val is invalid 2023-07-11T21:23:17.251Z ring-mqtt WARNING - Unhandled Promise Rejection 2023-07-11T21:23:17.251Z ring-mqtt TypeError: argument val is invalid

tsightler commented 1 year ago

What version of the addon are you using? This problem was fixed months ago.

lagge78 commented 1 year ago

Current version: 5.4.1

I found the issue, it was on my side. For some reason the addon didnt like when I routed the homeassistant trafic via a VPN. All good then, thanks for the quick reply.