Skip to content
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

First import fails, second import succeeds on julia 1.4.2 #153

Closed
bb4242 opened this issue Apr 7, 2021 · 5 comments
Closed

First import fails, second import succeeds on julia 1.4.2 #153

bb4242 opened this issue Apr 7, 2021 · 5 comments

Comments

@bb4242
Copy link

bb4242 commented Apr 7, 2021

Hi! I noticed that on julia 1.4.2, the first time I attempt to import AWSS3, it fails, but the second time succeeds:

julia> import AWSS3
ERROR: InitError: MethodError: Cannot `convert` an object of type Type{AWSS3.S3Path} to an object of type DataType
Closest candidates are:
  convert(::Type{T}, ::T) where T at essentials.jl:171
Stacktrace:
 [1] pushfirst!(::Array{DataType,1}, ::Type{T} where T) at ./array.jl:1151
 [2] register(::Type{AWSS3.S3Path}) at /home/bbethke/.julia/packages/FilePathsBase/qEgvF/src/FilePathsBase.jl:112
 [3] __init__() at /home/bbethke/.julia/packages/AWSS3/H9WJU/src/AWSS3.jl:40
 [4] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
 [5] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:781
 [6] _require(::Base.PkgId) at ./loading.jl:1006
 [7] require(::Base.PkgId) at ./loading.jl:927
 [8] require(::Module, ::Symbol) at ./loading.jl:922
during initialization of module AWSS3

julia> import AWSS3

julia> 

Do you have any idea what might cause this? I did notice that the import succeeds the first time when using julia 1.6.0, but I'm unfortunately stuck on 1.4.2 due to unrelated factors for the moment.

@mattBrzezinski
Copy link
Member

I've attempted to reproduce this with Julia 1 and 1.3 (as I don't have 1.4 installed), and was unable to. Do you run into this same issue when doing the following?

using AWSS3

@bb4242
Copy link
Author

bb4242 commented Apr 7, 2021

Thanks @mattBrzezinski! Yes, I do see the same issue when doing using AWSS3 instead of import AWSS3. A couple of other data points:

Still using julia 1.4.2, I tried installing AWSS3 version 0.7.7 instead of 0.8.3. After doing that, here are the packages I have installed:

julia> Pkg.installed()
┌ Warning: Pkg.installed() is deprecated
└ @ Pkg /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Pkg.jl:531
Dict{String,VersionNumber} with 27 entries:
  "D3Trees"               => v"0.3.1"
  "CUDA"                  => v"1.3.3"
  "Revise"                => v"3.1.14"
  "POMDPModelTools"       => v"0.3.5"
  "QuickPOMDPs"           => v"0.2.8"
  "AWS"                   => v"1.33.1"
  "StatsPlots"            => v"0.14.17"
  "MCTS"                  => v"0.4.7"
  "Measurements"          => v"2.3.0"
  "SIMD"                  => v"3.0.0"
  "LanguageServer"        => v"3.2.0"
  "QMDP"                  => v"0.1.5"
  "PkgTemplates"          => v"0.7.14"
  "IJulia"                => v"1.21.4"
  "YAML"                  => v"0.4.6"
  "Plots"                 => v"1.6.12"
  "POMDPSimulators"       => v"0.3.11"
  "POMDPModels"           => v"0.4.11"
  "POMDPPolicies"         => v"0.3.3"
  "StaticArrays"          => v"1.0.1"
  "DifferentialEquations" => v"6.15.0"
  "Knet"                  => v"1.4.5"
  "POMDPs"                => v"0.9.2"
  "Parameters"            => v"0.12.2"
  "Turing"                => v"0.15.8"
  "AWSS3"                 => v"0.7.7"
  "SymbolServer"          => v"5.1.1"

Interestingly, using that version, using AWSS3 works fine the first time. But I get a different error when running this little test script to download a file from S3:

using AWS
using AWSS3
c = global_aws_config(; region="us-west-2")
r = s3_get(c, <my bucket>, <my key>)
ERROR: LoadError: StackOverflowError:
Stacktrace:
 [1] s3_get(::Dict{Symbol,Any}, ::Dict{Symbol,Any}, ::Dict{Symbol,Any}, ::Dict{Symbol,Any}, ::Vararg{Any,N} where N) at /home/bbethke/.julia/packages/AWSS3/PpMPR/src/AWSS3.jl:177
 [2] s3_get(::Dict{Symbol,Any}, ::Vararg{Any,N} where N; b::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/bbethke/.julia/packages/AWSS3/PpMPR/src/AWSS3.jl:177
 ... (the last 2 lines are repeated 5611 more times)
 [11225] s3_get(::AWSConfig, ::String, ::String) at /home/bbethke/.julia/packages/AWSS3/PpMPR/src/AWSS3.jl:177
 [11226] top-level scope at /home/bbethke/s3.jl:7
 [11227] include(::Module, ::String) at ./Base.jl:377
 [11228] exec_options(::Base.JLOptions) at ./client.jl:288
in expression starting at /home/bbethke/s3.jl:7

@mattBrzezinski
Copy link
Member

[email protected] uses AWSCore.jl in the backend, while 0.8+ uses AWS.jl. The stack overflow error is probably because you're passing in an AWS.AWSConfig instead of an AWSCore.AWSConfig object.

Do you have any other versions of Julia that you use? I can setup 1.4 and see if I can reproduce later on this week.

@bb4242
Copy link
Author

bb4242 commented Apr 7, 2021

[email protected] uses AWSCore.jl in the backend, while 0.8+ uses AWS.jl. The stack overflow error is probably because you're passing in an AWS.AWSConfig instead of an AWSCore.AWSConfig object.

Ah, thanks! I was able to successfully run my script when using AWSCore.AWSConfig on [email protected].

Do you have any other versions of Julia that you use? I can setup 1.4 and see if I can reproduce later on this week.

I deleted my ~/.julia directory, installed julia 1.3.1 and 1.5.4, and tested those against AWSS3 (for fun, I tried against both 0.7.7 and 0.8.3. using AWSS3 works fine for both julia versions. Here's a summary table of everything I've tested so far:

julia 1.3.1 julia 1.4.2 julia 1.5.4 julia 1.6.0
AWSS3 0.7.7 works works works works
AWSS3 0.8.3 works fails works works

Haha so apparently this problem is very specific to julia 1.4.2 and AWSS3 0.8.3!

@ararslan
Copy link
Member

Closing as this package is now at 0.11 and requires Julia 1.6 at a minimum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants