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

Iceberg fail to function behind a proxy on Pharo 7 32bits #885

Open
guillep opened this Issue Jun 25, 2018 · 19 comments

Comments

Projects
None yet
4 participants
@guillep
Copy link
Member

guillep commented Jun 25, 2018

When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:

initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 4, 2018

It seems to be related to TLS 1.2. Does Iceberg forces the use of TLS 1.2 with libgit for github connections? Github only accepts TLS 1.2 only, so there would be no problem forcing it at least for github connections.

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 5, 2018

As it seems, it was made default to use TLS 1.2 on newer versions of libgit: *libgit2/libgit2#4550

@guillep

This comment has been minimized.

Copy link
Member Author

guillep commented Sep 5, 2018

Maybe we need to update to a newer version of libgit? @estebanlm we should change the VM build scripts for that?

@estebanlm

This comment has been minimized.

Copy link
Collaborator

estebanlm commented Sep 6, 2018

The problem with this is for win64, we are using the libgit2 library that comes with cygwin (mingw) because of problems to actually compile the library in the build chain. I would like to not depend on this version and instead take our libraries from our file server.
But still, there is the problem I did not find the time to compile it :/

So, I would not mind. But we need to find the appropriate version for all platforms.

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 6, 2018

I can confirm this problem happens in Pharo 6 win32 bits as well and I don't think it is an Iceberg problem anymore. It seems the right version for libgit2 would be at least v0.26.3.

@estebanlm, I am sorry, but I didn't understand well what you said :(, but the problem is that you don't have time to recompile it, is that so? It is possible for me to compile? If so, where should I look for resources to do that.

@estebanlm

This comment has been minimized.

Copy link
Collaborator

estebanlm commented Sep 11, 2018

something like that, yes :)
To compile libgit2 you have to follow https://github.com/libgit2/libgit2 instructions :)

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 17, 2018

Ok, I compiled libgit, but then the VM crashes. Can't send crash.dmp as it contains system info, some part of it is more relevant? I will try from home to see what happens.

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 17, 2018

Here is the crash.dmp from my home with the compiled libgit2.dll file:

crash.zip

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 18, 2018

This is probably API mismatch, wich version of libgit2 Pharo currently uses?

@estebanlm

This comment has been minimized.

Copy link
Collaborator

estebanlm commented Sep 18, 2018

0.25.1

@astares

This comment has been minimized.

Copy link
Contributor

astares commented Sep 18, 2018

@estebanlm
BTW: if we want to directly find out if a proxy is set in Windows using UFFI we might want to wrap

WINHTTP_PROXY_INFO structure and retrieve it using WinHttpGetDefaultProxyConfiguration
API function.

See
https://docs.microsoft.com/en-us/windows/desktop/api/winhttp/nf-winhttp-winhttpgetdefaultproxyconfiguration

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Sep 18, 2018

There is no backport of this issue to libgit2 0.25.x, I build 0.26.x version of the lib, where the crash happens. :(

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Oct 4, 2018

Is it too hard to update libgit version? Could I do that? If yes can you provide some leads?

@guillep

This comment has been minimized.

Copy link
Member Author

guillep commented Oct 4, 2018

The thing is that the libgit people do not provide precompiled binaries.

I managed to compile version 0.27.4 (from https://github.com/libgit2/libgit2/releases) in my mac. I had some troubles with libcurl and it took me more than I wanted...

Iceberg worked okish with that version (there was a bug related to some change in error handling). But otherwise there was really no big issue.

But I did not test proxy...

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Oct 4, 2018

I generated this version and tested: when I try to clone Pharo hangs. :( I am doing this on Pharo 6.1 with built in Iceberg since latest version is too much unstable yet.

Stack backtrace:
[01248564] ??? + 0x0 in (null)
[01248880] ??? + 0x0 in (null)
[590A5847] git_odb_num_backends + 0x11f0f9 in libgit2.dll
[59030E62] git_odb_num_backends + 0xaa714 in libgit2.dll
[590A8A5D] git_odb_num_backends + 0x12230f in libgit2.dll
[590A5E05] git_odb_num_backends + 0x11f6b7 in libgit2.dll
[59073962] git_odb_num_backends + 0xed214 in libgit2.dll
[59074725] git_odb_num_backends + 0xedfd7 in libgit2.dll
[58FD3AFF] git_odb_num_backends + 0x4d3b1 in libgit2.dll
[58FD2A0A] git_odb_num_backends + 0x4c2bc in libgit2.dll
[00C620EE] ??? + 0xe20ee in Pharo.exe
[00BC7254] ??? + 0x47254 in Pharo.exe
[04E89BD0] ??? + 0x389bd0 in CogCode

Smalltalk stack dump:
0x1255c94 M LGitRepository>clone:url:local_path:options: 0x4e18420: a(n) LGitRepository
0x1255cd0 I FFICalloutAPI>function:module: 0x4e723e0: a(n) FFICalloutAPI
0x1255cf8 I LGitRepository(LGitExternalObject)>callUnchecked:options: 0x4e18420: a(n) LGitRepository
0x1255d20 I LGitRepository>clone:url:local_path:options: 0x4e18420: a(n) LGitRepository
0x1255d5c I [] in LGitRepository>clone:options:to: 0x4e18420: a(n) LGitRepository
0x1255d7c I LGitRepository(LGitExternalObject)>withReturnHandlerDo: 0x4e18420: a(n) LGitRepository
0x1258aac I LGitRepository>clone:options:to: 0x4e18420: a(n) LGitRepository
0x1258ad8 I LGitRepository>clone:options: 0x4e18420: a(n) LGitRepository

@guillep

This comment has been minimized.

Copy link
Member Author

guillep commented Oct 5, 2018

I really don't believe that latest version (the one in Pharo7) is less stable than the one in Pharo6. It's maybe different from a user interface point of view, but it is far more predictable and it does not lose code on merges, and so on...

@estebanlm

This comment has been minimized.

Copy link
Collaborator

estebanlm commented Oct 5, 2018

why you say latest version is unstable? Is a lot more stable than the one you are using.

@estebanlm

This comment has been minimized.

Copy link
Collaborator

estebanlm commented Oct 5, 2018

said that.
we will try to move to 0.27 as soon as we can compile all library version needed.

@vitormcruz

This comment has been minimized.

Copy link

vitormcruz commented Oct 6, 2018

Well, I tried to use Pharo 7 for some time for very small things really, and I had some problems. With Iceberg I almost loose code from a merge between me (at home) and myself (at work). I also had some scary red window with X crossed. In the end I decided to use Pharo 6.1 and wait Pharo 7 pass through alfa phase. I also decided to use the version of Iceberg that comes with 6.1 to avoid problems. Its been some months since then, so I don't the state of affairs now.

I compiled the new version of libgit and attached here git2.zip, in both windows 10 and 7 Pharo 6.1 hangs.

I can confirm the problem is really with TLS 1.2 since I managed to install the Windows fix in the machine I was having the above problem and this solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment