Comments (10)
Thanks for reporting the issue. Is it for uploadPart API? Are you using a proxy server? Do you have same issue for PutObject API (single upload).
from oci-go-sdk.
from oci-go-sdk.
For your first timeout error, you can either change the clientTimeout, but for larger object or unreliable network which takes un-predictable time to upload (wait for responseHeader come back). You could also set the http.Transport.ResponseHeaderTimeout to 0.
BTW, for "latest version of oci-go-sdk", were you referring to V1.2.0?
Looks like you are not using the default httpClient or http.Transport? If yes, could you pls share the code so I can try to repro the issue you have?
from oci-go-sdk.
I'm using the Latest version of Master and whatever httpClient is built into the code pkgs
"github.com/oracle/oci-go-sdk/common"
"github.com/oracle/oci-go-sdk/example/helpers"
"github.com/oracle/oci-go-sdk/objectstorage"
from oci-go-sdk.
I need more information to debug the issue, especially how you split the file into multi-parts. Sharing the code would be helpful, however, with limited information here, I noticed that the http.ContentLength is different than the body length which will cause golang http transport through error. Could be an bug around 'UploadPartBody' for UploadPartRequest. I would try to set it as
UploadPartBody: ioutil.NopCloser(bytes.NewReader(buffer)),
net/http: HTTP/1.x transport connection broken: http: ContentLength=104857600 with Body length 385447926
After Change to smaller split size:
net/http: HTTP/1.x transport connection broken: http: ContentLength=20971520 with Body length 385447926
from oci-go-sdk.
@jasonyin I'll put something together and add it to the ticket but this is part of a larger application so it will take me a little while.
Not sure this small part will help, otherwise I'll work on the attachment.
`func (o *ObjStore) UploadPart(bucketName, objectName, uploadId string, partNo, contentLength int, content io.ReadCloser) *string {
namespace := o.GetNamespace()
request := objectstorage.UploadPartRequest{
NamespaceName:&namespace,
BucketName:&bucketName,
ObjectName:&objectName,
UploadId:&uploadId,
UploadPartNum:&partNo,
ContentLength:&contentLength,
UploadPartBody:content,
}
r, err := o.client.UploadPart(*o.context, request)
helpers.LogIfError(err)
return r.ETag
}`
from oci-go-sdk.
Thanks for sharing the info!
There are two key input parameters here, contentLength and content (in your sample code):
-
The contentLength is the length of the part you are uploading (100M or 20M in your error trace) which is correct;
-
Body length (shows in the error trace) is 368M fixed which looks wrong to me, it should be same as the part size you are uploading (i.e. 20M or 100M depends on the size of part), it's not the size of the file you are uploading (368M). The body length in the error trace comes from your content parameter( io.ReaderCloser), I suspect that the content parameter you are using was wrong. Here is a sample code, hoping it helps to debug the issue:
// make a buffer with partSize (i.e. 20M or 100M)
buffer := make([]byte, partSize)
// load content from the file you are uploading into a buffer
_, err := file.ReadAt(buffer, offset)
// try to update your code with following line, I think it most likely would fix the issue
content := ioutil.NopCloser(bytes.NewReader(buffer))
Please let me know if you have any questions/issues, thanks!
net/http: HTTP/1.x transport connection broken: http: ContentLength=104857600 with Body length 385447926
After Change to smaller split size:
net/http: HTTP/1.x transport connection broken: http: ContentLength=20971520 with Body length 385447926
from oci-go-sdk.
I found the issue with this particular piece.
Thank you for your time.
from oci-go-sdk.
glad you got the issue resolved, could you pls share the root cause for the issue? is it because the upload part stream you were using was entire file not the split part?
from oci-go-sdk.
@jasonyin yes I had a typo in there (wrong var)
from oci-go-sdk.
Related Issues (20)
- OkeWorkloadIdentityConfigurationProvider example HOT 1
- Operation fails with NotAuthorizedOrNotFound but same operation succeeds when using CLI HOT 7
- SDK testability and mocks HOT 5
- `UploadRequest` creates `ObjectStorageClient` when uploading request is processing. HOT 1
- Unable to retrieve actual object storage bucket size HOT 4
- Retry policy does not retry ephemeral network errors HOT 6
- Token not present in Identity Domains' `CreateAuthTokenResponse` and `CreateMyAuthTokenResponse` HOT 6
- missing LaunchOptions in CreateImageDetails struct HOT 3
- ListExternalContainerDatabases is not returning list of all databases in that region HOT 3
- Support MappedAttributes for IdentityDomains HOT 3
- Support Policies for Identity Domains HOT 1
- Support Rules for Identity Domains HOT 1
- Issue with endpoint - Oracle Queue HOT 4
- The API `ListInstances`of `ComputeClient` does not return any value for the attribute `PlatformConfig` HOT 10
- encrypted PKCS#8 API private keys are not supported HOT 1
- The API `ListInstances` of `ComputeClient` returns `TLS handshake timeout` error with large number of result set.
- Stream client's PutMessages() doesn't fully utilize retry policies. HOT 1
- ERROR: LaunchInstance HOT 1
- OkeWorkloadIdentityConfigurationProvider looking for OCI_RESOURCE_PRINCIPAL_VERSION environment HOT 2
- support the same environment variables as the CLI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oci-go-sdk.