Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Problem with Repositories.Archive() [STREAM error] #114

Closed
juxR opened this issue Jan 15, 2017 · 2 comments
Closed

Problem with Repositories.Archive() [STREAM error] #114

juxR opened this issue Jan 15, 2017 · 2 comments

Comments

@juxR
Copy link
Contributor

juxR commented Jan 15, 2017

Hi,

My go version is: go1.7.4 darwin/amd64

I'm unable to use the Repositories.Archive() method without having an error about stream:
stream error: stream ID 1; PROTOCOL_ERROR.
I must add that i didn't have the problem like 2 months ago (since then, i have updated dependencies and go bin)

When i'm doing the call to gitlab api using postman and the same token, i don't have any errors.
i dont know if the problem is from this package, golang or ... ?

Here is the go code (hash = 0.6.0 and projectNamespaceOrId = 365):

opt := &gitlabApi.ArchiveOptions{SHA: &hash}
bites, _, err := gitlab.Client.Repositories.Archive(projectNamespaceOrId, opt)

And here is a screen when using postman:
https://cl.ly/0g3q0F3P1Q07

Here is the nginx log when calling repository using go:
https://cl.ly/0J412s3F1Q0l

I don't have this error for any other calls that are made by the package, so i really don't know what's the problem.

Help would be appreciate

@svanharmelen
Copy link
Member

@julienroland it didn't ring any bells, but after some googling I suspect you're maybe hitting this issue: golang/go#16847

Go 1.8 should contain a fix for this, so if you have any chance to test/confirm this with Go 1.8 RC1 (it's on the bottom of the page) that would be realy awesome!

Additionally you should be able to work around this by setting Transport.TLSNextProto to a non-nil, empty map (see here for more details), which effectively disables using HTTP/2 and falls back to using HTTP/1.1.

@juxR
Copy link
Contributor Author

juxR commented Jan 16, 2017

Thank you very much @svanharmelen !

I tried using go1.8rc1 but it still doesn't work.
Which is strange because, it works well when i disable http2 like u mentioned (the work around).

Here is the code if someone needs it:

```
     http.DefaultClient.Transport = &http.Transportc{
    TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
 }
  ```

Thanks for you help !

@juxR juxR closed this as completed Jan 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants