pharo-vcs / iceberg

Iceberg is the main toolset for handling VCS in Pharo.
MIT License
134 stars 85 forks source link

Iceberg keeps using the SSH remote even if HTTPS is selected in the Settings #1628

Open dmatveev opened 2 years ago

dmatveev commented 2 years ago

Hi folks!

Got the root cause of the issue I was experiencing while setting my new corporate laptop (Windows10 + VPN+proxy). When I first try to load my package with Metacello via a baseline, it just hangs. That's expected as the SSH checkout never worked well for me in Pharo on Windows.

However, if I change my remote type in Iceberg settings from SSH to HTTPS, it won't work either -- even if the correct proxy parameters specified in the same Settings window. Note I struggled with it some time and restarted the VM a couple of times to check if settings apply. Maybe that was the case.

What I've found from the debug stack trace was that in the second attempt, Iceberg still tried to checkout the repo via SSH link, not the HTTPS one. I checked the local filesystem (under pharo-local/iceberg) and found an "empty" directory for my repo there -- it seems it was initialized by Iceberg on the first (faulty) attempt and its remote was set to the SSH url. For some reason, Iceberg decided to reuse that remote URL to continue clone attempts even after the remote type has been set to HTTP.

Not sure how a faulty repository has left on disk and wasn't cleared up after an unsuccessful clone. Maybe it was a terminated VM or smt like that.

Originally reproduced with Pharo 10:

Pharo 10.0.0
Build information: Pharo-10.0.0+build.535.sha.f72dfb7a95cb072d485373b28b33e8c256b9a3f2 (64 Bit)

Tried to reproduce it with Pharo 9 -- but Iceberg signaled that the repo directory already exists. A new (fresh) image of Pharo10 of the same revision worked well after first failure and the remote change to HTTPS.

Ducasse commented 2 years ago

Thanks a lot. We discovered this too during our lecture https://github.com/UnivLille-Meta/Miage22 (end of the page). What we saw is that monticello/metacello is using ssh even if we configure iceberg to use https. Can you tell me if it helps you?

dmatveev commented 2 years ago

@Ducasse sure, in my case I just removed the broken repo from the file system and a new clone worked as a charm

Ducasse commented 2 years ago

My question was if this is the same problem. Sorry I was not clear enough because I would like to see the issue (or issues) fixed.

dmatveev commented 2 years ago

Yeah the problem looks the same. But what's weird I couldn't reproduce it anymore with a fresh image. It seems VM needs to crash or to be terminated so an "empty" repo directory with .git stays on disk and then (on the next VM start) Iceberg would load/cache the SSH remote for the repo instead of the HTTPS one.