# Help Needed: S3 Connection Error with MinIO in Development Environment

**URL:** https://discourse.julialang.org/t/help-needed-s3-connection-error-with-minio-in-development-environment/122957
**Category:** Data
**Tags:** question, package
**Created:** [November 22, 2024, 1:29pm UTC](https://discourse.julialang.org/t/help-needed-s3-connection-error-with-minio-in-development-environment/122957 "2024-11-22T13:29:36Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![OgmaJ](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ogmaj/32/213617_2.png) [@OgmaJ](https://discourse.julialang.org/u/OgmaJ)
#### Post date: [November 26, 2024, 9:16pm UTC](https://discourse.julialang.org/t/help-needed-s3-connection-error-with-minio-in-development-environment/122957/10 "2024-11-26T21:16:02Z")

</div>

Thank you, @ericphanson, for providing such a great initial insight. Your comment about the missing values really caught my attention. At first, I was quite surprised, so I decided to bring in my teammate, @tencnivel, for a pair programming session to dive deeper into this.

We updated the HTTP package, but unfortunately, we’re still encountering the same issue with the error:

```julia
SubArray{UInt8,1,Memory{UInt8},Tuple{UnitRange{Int64}},true} to an object of type

SubArray{UInt8,1,Vector{UInt8},Tuple{UnitRange{Int64}},true}

```

Very strange indeed. My teammate (shoutout to @tencnivel) came across this post and read it and share it to me:

> [@Memory{T} in 1.11](https://discourse.julialang.org/t/memory-t-in-1-11/111811):
>
> Hi, While running my code with the 1.11 alpha 2 version of Julia, it broke due (I think) to a change introduced in Julia 1.11. In the following code: d = IOBuffer("hello") dd = d.data dd is a Vector{UInt8} in julia 1.10 but is a Memory{UInt8} in 1.11. Which broke my code because there is no insert! function for Memory{UInt8} 1/ the Julia documentation says it is “One-dimensional dense array with element of type T.” What is the difference with Vector{T} ? And in which case should I use Memo…

I downgraded my julia version (1.11 =\> 1.10) and tada everything works fine.

By the way, here’s my updated script that works well with MinIO and likely other standard S3 integrations (I don’t see any working example anywhere, maybe it will help).

```julia
import Pkg

# Activate the project environment located at the script's directory
Pkg.activate(@ __DIR__ )
Pkg.add("AWS")
Pkg.add("AWSS3")
Pkg.instantiate() # Ensures all dependencies are installed
using AWS
using AWSS3

struct MinioConfig <: AbstractAWSConfig
    endpoint::String
    region::String
    require_ssl_verification::Bool
    creds
 end
 AWS.region(c::MinioConfig) = c.region
 AWS.credentials(c::MinioConfig) = c.creds

struct SimpleCredentials
    access_key_id::String
    secret_key::String
    token::String
end
AWS.check_credentials(c::SimpleCredentials) = c

#ENV["AWS_SECRET_ACCESS_KEY"] = "WEOaG7gFONUK185aXE5s0JZpTXV04chpjGXrfxq8"
#ENV["AWS_ACCESS_KEY_ID"] = "3nbu1tyiaQ2lN0A5DYmp"

function AWS.generate_service_url(aws::MinioConfig, service::String, resource::String)
    service == "s3" || throw(ArgumentError("Can only handle s3 requests to Minio"))
    return string(aws.endpoint, resource)
end

aws_config = AWS.global_aws_config(MinioConfig("http://127.0.0.1:9000", "",false, SimpleCredentials("3nbu1tyiaQ2lN0A5DYmp", "WEOaG7gFONUK185aXE5s0JZpTXV04chpjGXrfxq8", "")))

@info "after aws_config"
try
    p = S3Path("s3://testapi/test1.txt") # provides an filesystem-like interface
    #buckets = s3_list_buckets(;aws_config)
    res = read(p, byte_range=1:4) # returns b"some"
    @info "res:" String(res)
catch e
    println("Stack trace:")
    showerror(stderr, e, Base.catch_backtrace())
    println(aws_config)
end
@info "after s3"

```

Btw, I noticed that everyone in this thread is helping others. Feel free to tag me if anyone encounters issues with S3 (and other AWS vendors) —I’d be happy to assist!

thx guys !!  
cc @ericphanson , @tencnivel , @drizk1

---

_[View the full topic](https://discourse.julialang.org/t/help-needed-s3-connection-error-with-minio-in-development-environment/122957)._
