An issue occured with putObject after lib has updated from 1.11.445 to 1.11.486 #3458
Unanswered
StorozhilovTimofey
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So, I have a simple "Hello world!" code with PUT and GET requests:
`#include <aws/core/Aws.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/PutObjectRequest.h>
#include <aws/s3/model/GetObjectRequest.h>
#include
int main(int argc, char *argv[])
{
if (argc < 3U) {
std::cerr << "ERROR: S3 endpoint or bucket name are not specified" << std::endl;
return 1;
}
}`
This code works properly on 1.11.445 version, but when I updated to 1.11.486 or any later version I receive an error. Here is the full log: Running AWS S3 API smoke test
Connecting to 'minikube.192.168.49.2.nip.io:31190' S3 endpoint
Connected to 'minikube.192.168.49.2.nip.io:31190' S3 endpoint
Uploading 'testing-object' object to 'cloudfs' bucket
ERROR: PutObject: Unable to parse ExceptionName: MissingContentLength Message: You must provide the Content-Length HTTP header.
I tried to use the SetContentLength method, but it doesn't work. To run the code I'm using the run.sh script:
`#!/usr/bin/env bash
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
. "${script_dir}"/../../ci/utils.sh
minio_endpoint=$(get_service_endpoint minio-service "${QTR_COMMON_SANDBOX_NS}" external)
AWS_ACCESS_KEY_ID=${QTR_COMMON_MINIO_USER}
AWS_SECRET_ACCESS_KEY=${QTR_COMMON_MINIO_PASSWORD}
${CLOUDFS_PROJECT_ROOT}/ci/build/src/temp/hello_world_aws "${minio_endpoint}" "${CLOUDFS_MINIO_BUCKET}"
The version of minIO is RELEASE.2023-04-13T03-08-07Z. And this is my CMakeLists.txt file if need:
cmake_minimum_required(VERSION 3.16)project(hello_world_aws)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(AWSSDK REQUIRED COMPONENTS s3)
set(SOURCES main.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME}
PRIVATE ${AWSSDK_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} ${AWSSDK_LIBRARIES})`
The output, when I run on 1.11.445 version: Running AWS S3 API smoke test
Connecting to 'minikube.192.168.49.2.nip.io:31190' S3 endpoint
Connected to 'minikube.192.168.49.2.nip.io:31190' S3 endpoint
Uploading 'testing-object' object to 'cloudfs' bucket
Successfully uploaded 'testing-object' object to 'cloudfs' bucket
Fetching 'testing-object' object from 'cloudfs' bucket
Successfully fetched 'testing-object' from 'cloudfs' bucket
AWS S3 API smoke test passed
Also I tried to set AWS_REQUEST_CHECKSUM_CALCULATION=WHEN_REQUIRED var in run.sh script according to this.
Please help me understand what the problem is and what could be the solutions. I guess the problem is in minIO, but maybe it's not the reason...
Beta Was this translation helpful? Give feedback.
All reactions