-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync attempt causes 401 auth required after 0.19.2 -> 0.19.3 update #1138
Comments
cc: @malmeloo |
I did a little digging and what I think is happening here is aiohttp dropping the |
Ah, aiohttp! I think i've found the issue.
It is using a credential entry in ~/.netrc for the autentication. Because in ~/.netrc only the machine name is configured so it seems to be using it for all requests on that host regardless of the subpath. The question now is can it be changed so the values in ~/.config/vdirsyncer/config have higher priority than the generic ~/.netrc EDIT: As far as i understand the aiohttp documentation ~/.netrc should only be used related to proxy authentication. Does it consider a web service behind a reverse proxy such as Apache or nginx needs to be treated like a Squid web cache that requires auth? |
I’ll take a patch that disables netrc support when invoking aiohttp. It isn’t a supported mechanism for Vdirsyncer.
|
That option should still be off by default though, so I'm not entirely convinced that's the problem here. But I will investigate a little more and see if I can repro. |
I don't see an explicit option for this. It's tied to the "trust_env" option in "aiohttp.ClientSession" though
vdirsyncer currently is using "True": Setting it to "False" fixes the issue for me. It also does disable a users ability to set the NETRC environment to have an alternative to the hardcoded ~/.netrc |
Oh the option is enabled? Right, that explains the issue then. I think disabling it would also disable support for setting proxy details using env vars though, is that desirable? |
Not really, a lot more people probably use the "http_proxy" environment variables. Knowing the root cause of the issue, I have some workarounds for the time being like running "NETRC=/dev/null vdirsyncer sync" |
If that fixes it we could probably override that env var in vdirsyncer, as a workaround... The more I learn about aiohttp, the more I'm starting to dislike it. |
Yes, please. Having the env var set to something like /dev/null by default would help. vdirsyncer has it's own username and password settings. I see no benefit in using the less flexible and if present probably used for something else ~/.netrc instead. |
@cbirchinger could you try #1141 to see if it fixes the issue? |
Yes, that fixes the issue. Thank you. |
After updating from 0.19.2 to 0.19.3 the server rejects the connection with 401 instead of 207 (-vdebug outputs below)
Nothing other than the update from 0.19.2 to 0.19.3 was changed. Same Python, same configuration, same server setup. Downgrading to 0.19.2 again fixes the issue and the sync works again
Server: Radicale 3.2.3 behind Apache 2.4.62 (mod_proxy)
OS: Gentoo Linux (Server and Client)
Python: 3.12
Hardcoded password instead of password.fetch was also tried without success.
-vdebug output of 0.19.3 (FAIL)
-vdebug output of 0.19.2 (OK)
config
Apache vhost
The text was updated successfully, but these errors were encountered: