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

Issue with return type of readuntil #1192

Closed
orenbenkiki opened this issue Nov 7, 2024 · 5 comments
Closed

Issue with return type of readuntil #1192

orenbenkiki opened this issue Nov 7, 2024 · 5 comments

Comments

@orenbenkiki
Copy link

julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 14 × Apple M3 Max
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m3)
Threads: 1 default, 0 interactive, 1 GC (on 10 virtual cores)
Environment:
  JULIA_DEBUG = Programs,Extractors,Main,Writers,ConstrainedKMeans

julia> using HTTP

julia> HTTP.VERSION
v"1.11.1"

julia> using MbedTLS_jll

julia> MbedTLS_jll.VERSION
v"1.11.1"

HTTP.request("GET", "https://media.githubusercontent.com/media/tanaylab/Gmara/main/genes/human/lists/transcription_factor.curated/names/GeneSymbol.tsv")
ERROR: MethodError: Cannot `convert` an object of type 
  SubArray{UInt8,1,Memory{UInt8},Tuple{UnitRange{Int64}},true} to an object of type 
  SubArray{UInt8,1,Vector{UInt8},Tuple{UnitRange{Int64}},true}
The function `convert` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  SubArray{T, N, P, I, L}(::Any, ::Any, ::Any, ::Any) where {T, N, P, I, L}
   @ Base subarray.jl:19
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:126
  convert(::Type{T}, ::LinearAlgebra.Factorization) where T<:AbstractArray
   @ LinearAlgebra ~/.julia/juliaup/julia-1.11.1+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/factorization.jl:104
  ...

Stacktrace:
  [1] readuntil(buf::IOBuffer, find_delimiter::typeof(HTTP.Parsers.find_end_of_header))
    @ HTTP.IOExtras ~/.julia/packages/HTTP/aTjcj/src/IOExtras.jl:139
  [2] readuntil(t::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, f::Function, sizehint::Int64)
    @ HTTP.ConnectionPool ~/.julia/packages/HTTP/aTjcj/src/ConnectionPool.jl:296
  [3] readuntil(t::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, f::Function)
    @ HTTP.ConnectionPool ~/.julia/packages/HTTP/aTjcj/src/ConnectionPool.jl:292
  [4] readheaders(io::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, message::HTTP.Messages.Response)
    @ HTTP.Messages ~/.julia/packages/HTTP/aTjcj/src/Messages.jl:537
  [5] startread(http::HTTP.Streams.Stream{HTTP.Messages.Response, HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}})
    @ HTTP.Streams ~/.julia/packages/HTTP/aTjcj/src/Streams.jl:170
  [6] macro expansion
    @ ~/.julia/packages/HTTP/aTjcj/src/StreamRequest.jl:67 [inlined]
  [7] macro expansion
    @ ./task.jl:498 [inlined]
  [8] request(::Type{…}, io::HTTP.ConnectionPool.Transaction{…}, req::HTTP.Messages.Request, body::Vector{…}; reached_redirect_limit::Bool, response_stream::Nothing, iofunction::Nothing, verbose::Int64, kw::@Kwargs{})
    @ HTTP.StreamRequest ~/.julia/packages/HTTP/aTjcj/src/StreamRequest.jl:57
  [9] request(::Type{…}, url::URIs.URI, req::HTTP.Messages.Request, body::Vector{…}; proxy::Nothing, socket_type::Type, reuse_limit::Int64, kw::@Kwargs{})
    @ HTTP.ConnectionRequest ~/.julia/packages/HTTP/aTjcj/src/ConnectionRequest.jl:108
 [10] (::Base.var"#106#108"{Base.var"#106#107#109"{ExponentialBackOff, HTTP.RetryRequest.var"#2#3"{}, typeof(HTTP.request)}})(::Type, ::Vararg{Any}; kwargs::@Kwargs{iofunction::Nothing, reached_redirect_limit::Bool, canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ Base ./error.jl:300
 [11] request(::Type{RetryLayer{…}}, url::URIs.URI, req::HTTP.Messages.Request, body::Vector{UInt8}; retries::Int64, retry_non_idempotent::Bool, kw::@Kwargs{iofunction::Nothing, reached_redirect_limit::Bool, canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ HTTP.RetryRequest ~/.julia/packages/HTTP/aTjcj/src/RetryRequest.jl:44
 [12] request(::Type{…}, method::String, url::URIs.URI, headers::Vector{…}, body::Vector{…}; http_version::VersionNumber, target::String, parent::Nothing, iofunction::Nothing, kw::@Kwargs{})
    @ HTTP.MessageRequest ~/.julia/packages/HTTP/aTjcj/src/MessageRequest.jl:66
 [13] request(::Type{CanonicalizeLayer{MessageLayer{…}}}, method::String, url::URIs.URI, headers::Vector{Pair{SubString{…}, SubString{…}}}, body::Vector{UInt8}; kw::@Kwargs{reached_redirect_limit::Bool, canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ HTTP.CanonicalizeRequest ~/.julia/packages/HTTP/aTjcj/src/CanonicalizeRequest.jl:20
 [14] request(::Type{BasicAuthLayer{CanonicalizeLayer{…}}}, method::String, url::URIs.URI, headers::Vector{Pair{SubString{…}, SubString{…}}}, body::Vector{UInt8}; kw::@Kwargs{reached_redirect_limit::Bool, canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ HTTP.BasicAuthRequest ~/.julia/packages/HTTP/aTjcj/src/BasicAuthRequest.jl:28
 [15] request(::Type{RedirectLayer{BasicAuthLayer{…}}}, method::String, url::URIs.URI, headers::Vector{Pair{SubString{…}, SubString{…}}}, body::Vector{UInt8}; redirect_limit::Int64, forwardheaders::Bool, kw::@Kwargs{canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ HTTP.RedirectRequest ~/.julia/packages/HTTP/aTjcj/src/RedirectRequest.jl:28
 [16] request(::Type{TopLayer{RedirectLayer{BasicAuthLayer{CanonicalizeLayer{MessageLayer{RetryLayer{ConnectionPoolLayer{StreamLayer{Union{}}}}}}}}}}, ::String, ::Vararg{Any}; kwargs::@Kwargs{canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ HTTP.TopRequest ~/.julia/packages/HTTP/aTjcj/src/TopRequest.jl:15
 [17] request(method::String, url::String, h::Vector{Pair{String, String}}, b::Vector{UInt8}; headers::Vector{Pair{String, String}}, body::Vector{UInt8}, query::Nothing, kw::@Kwargs{canonicalize_headers::Bool, status_exception::Bool, decompress::Bool})
    @ HTTP ~/.julia/packages/HTTP/aTjcj/src/HTTP.jl:330
 [18] request
    @ ~/.julia/packages/HTTP/aTjcj/src/HTTP.jl:328 [inlined]
 [19] top-level scope
    @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> 
@fredrikekre
Copy link
Member

I think you need to update to latest HTTP.jl

@orenbenkiki
Copy link
Author

It seems I have the latest:

(@v1.11) pkg> update HTTP
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.11/Project.toml`
  No Changes to `~/.julia/environments/v1.11/Manifest.toml`

(@v1.11) pkg> 

@orenbenkiki
Copy link
Author

That said, downgrading to 1.10.9 solves the problem. So it seems to be something new in 1.11.1.

@fredrikekre
Copy link
Member

1.10.9 is the latest, you are printing the Julia version.

@orenbenkiki
Copy link
Author

Yes, you are right:

(@v1.11) pkg> status --outdated
Status `~/.julia/environments/v1.11/Project.toml`
⌅ [cd3eb016] HTTP v0.9.17 (<v1.10.9): Mux, Plotly, WebSockets
⌅ [cf896787] SymbolServer v7.4.0 (<v8.0.0): LanguageServer

(@v1.11) pkg> 

Leaves me pretty stuck though... I don't suppose there's any workaround?

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

2 participants