I'm looking to write some simple ETL scripts to query an API in R. They only authenticate successfully after I have run update.packages('openssl') and I'm not exactly sure what this means, beyond something being misconfigured.
Edit with runnable sample:
The following test GET request...
library(httr)
library(openssl)
library(tidyverse)
library(DBI)
#### SET QUERY/FORM VARIABLES ####
#### SET URL ENDPOINTS ####
api_base <- 'https://reqres.in'
sub_endpt <- '/api/unknown/2'
sub_url <- paste0(api_base, sub_endpt)
page_req <- GET(sub_url
, encode = 'json'
, verbose(info=TRUE)
...generates the following error:
* Trying 172.67.222.36...
* TCP_NODELAY set
* Connected to reqres.in (172.67.222.36) port 443 (#0)
* schannel: SSL/TLS connection with reqres.in port 443 (step 1/3)
* schannel: disabled server certificate revocation checks
* schannel: sending initial handshake data: sending 157 bytes...
* schannel: sent initial handshake data: sent 157 bytes
* schannel: SSL/TLS connection with reqres.in port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with reqres.in port 443 (step 2/3)
* schannel: encrypted data got 139
* schannel: encrypted data buffer: offset 139 length 4096
* schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
* Closing connection 0
* schannel: shutting down SSL/TLS connection with reqres.in port 443
* schannel: clear security context handle
Error in curl::curl_fetch_memory(url, handle = handle) :
schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
This same script works after running update.packages('openssl'), but only if update.packages('openssl') is run each time.
library(httr)
library(openssl)
library(tidyverse)
library(DBI)
update.packages('openssl')
#### SET QUERY/FORM VARIABLES ####
#### SET URL ENDPOINTS ####
api_base <- 'https://reqres.in'
sub_endpt <- '/api/unknown/2'
sub_url <- paste0(api_base, sub_endpt)
page_req <- GET(sub_url
, encode = 'json'
, verbose(info=TRUE)
)
After running the above, I instead receive:
Hostname in DNS cache was stale, zapped
* Trying 104.21.59.93...
* TCP_NODELAY set
* Connected to reqres.in (104.21.59.93) port 443 (#1)
* schannel: SSL/TLS connection with reqres.in port 443 (step 1/3)
* schannel: disabled server certificate revocation checks
* schannel: sending initial handshake data: sending 157 bytes...
* schannel: sent initial handshake data: sent 157 bytes
* schannel: SSL/TLS connection with reqres.in port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with reqres.in port 443 (step 2/3)
* schannel: encrypted data got 2563
* schannel: encrypted data buffer: offset 2563 length 4096
* schannel: sending next handshake data: sending 126 bytes...
* schannel: SSL/TLS connection with reqres.in port 443 (step 2/3)
* schannel: encrypted data got 258
* schannel: encrypted data buffer: offset 258 length 4096
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with reqres.in port 443 (step 3/3)
* schannel: stored credential handle in session cache
-> GET /api/unknown/2 HTTP/1.1
-> Host: reqres.in
-> User-Agent: libcurl/7.59.0 r-curl/3.3 httr/1.4.1
-> Accept-Encoding: gzip, deflate
-> Accept: application/json, text/xml, application/xml, */*
->
* schannel: client wants to read 16384 bytes
* schannel: encdata_buffer resized 17408
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: encrypted data got 1168
* schannel: encrypted data buffer: offset 1168 length 17408
* schannel: decrypted data length: 1105
* schannel: decrypted data added: 1105
* schannel: decrypted data cached: offset 1105 length 16384
* schannel: encrypted data length: 34
* schannel: encrypted data cached: offset 34 length 17408
* schannel: decrypted data length: 5
* schannel: decrypted data added: 5
* schannel: decrypted data cached: offset 1110 length 16384
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: decrypted data buffer: offset 1110 length 16384
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 1110
* schannel: decrypted data buffer: offset 0 length 16384
<- HTTP/1.1 200 OK
<- Date: Sat, 29 Jan 2022 16:11:59 GMT
<- Content-Type: application/json; charset=utf-8
<- Transfer-Encoding: chunked
<- Connection: keep-alive
<- x-powered-by: Express
<- access-control-allow-origin: *
<- etag: W/"e8-ov4wWh4/OY1IMQMqWgskYtOFnVs"
<- via: 1.1 vegur
<- Cache-Control: max-age=14400
<- CF-Cache-Status: REVALIDATED
<- Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
<- Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=fyNvgiYFkSfx2bLgj4G0uybx5hN7f9uUIiFjrgijkYbZD7FkoBWhZfFl%2BniMEaaf%2B8Ur5nMmH1Pe3mCgnwudLptXgIaYDRi8WZvItt%2Fz69En%2B%2BwTEhWhRuBbMDk%3D"}],"group":"cf-nel","max_age":604800}
<- NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
<- Vary: Accept-Encoding
<- Server: cloudflare
<- CF-RAY: 6d53bd4fe9628c90-EWR
<- Content-Encoding: gzip
<- alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
<-
* Connection #1 to host reqres.in left intact
I've confirmed this fails with the same error if I restart my R session and run the script without update.packages('openssl').
I've also confirmed that this also succeeds when I run update.packages('openssl') before any of my library imports.
Original Post
I'm using the following libraries:
library(httr)
library(curl)
library(openssl)
library(tidyverse)
library(DBI)
After these imports, my sessionInfo() is:
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DBI_1.1.0 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.0 purrr_0.3.4 readr_1.3.1
[7] tidyr_1.1.0 tibble_3.0.2 ggplot2_3.3.2 tidyverse_1.3.0 openssl_1.4.2 curl_3.3
[13] httr_1.4.1 RevoUtils_11.0.2 RevoUtilsMath_11.0.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 cellranger_1.1.0 pillar_1.4.6 compiler_4.0.2 dbplyr_1.4.4 tools_4.0.2 lubridate_1.7.9
[8] jsonlite_1.7.0 lifecycle_0.2.0 gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.6 reprex_0.3.0 cli_2.0.2
[15] rstudioapi_0.11 haven_2.3.1 withr_2.2.0 xml2_1.3.2 fs_1.4.2 hms_0.5.3 generics_0.0.2
[22] vctrs_0.3.1 askpass_1.1 grid_4.0.2 tidyselect_1.1.0 glue_1.4.1 R6_2.3.0 fansi_0.4.1
[29] readxl_1.3.1 modelr_0.1.8 blob_1.2.1 magrittr_1.5 backports_1.1.7 scales_1.1.1 ellipsis_0.3.1
[36] rvest_0.3.5 assertthat_0.2.1 colorspace_1.4-1 stringi_1.4.6 munsell_0.5.0 broom_0.7.0 crayon_1.3.4
When I import those libraries and then run my script, I get the following:
schannel: SSL/TLS connection with www.formstack.com port 443 (step 1/3)
* schannel: disabled server certificate revocation checks
* schannel: sending initial handshake data: sending 165 bytes...
* schannel: sent initial handshake data: sent 165 bytes
* schannel: SSL/TLS connection with www.formstack.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with www.formstack.com port 443 (step 2/3)
* schannel: encrypted data got 139
* schannel: encrypted data buffer: offset 139 length 4096
* schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
* Closing connection 0
* schannel: shutting down SSL/TLS connection with www.formstack.com port 443
* schannel: clear security context handle
Error in curl::curl_fetch_memory(url, handle = handle) :
schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
My script succeeds when I instead run:
library(httr)
library(curl)
library(openssl)
library(tidyverse)
library(DBI)
update.packages('openssl')
I suspected that this might have something to do with a conflict between curl and httr, because of this upon import:
> library(curl)
Attaching package: ‘curl’
The following object is masked from ‘package:httr’:
handle_reset
But the script also succeeds when I run the update first and swap the order of httr and curl imports, such as:
update.packages('openssl')
library(curl)
library(httr)
library(openssl)
library(tidyverse)
library(DBI)
I hope that's enough to help troubleshoot what's wrong in my environment here and appreciate any and all lessons about library maintenance / dependencies.
Reading in a csv file should be straight forward, right? But when I do this:
df = CSV.read("sources/diamonds2.csv")
I get some bad-ass error message:
ERROR: MethodError: no method matching Parsers.Options(::Missing, ::UInt8, ::UInt8, ::UInt8, ::UInt8, ::UInt8, ::UInt8, ::UInt8, ::Nothing, ::Nothing, ::Nothing, ::Bool, ::Bool, ::Nothing, ::Bool, ::Bool, ::Bool, ::Bool)
Closest candidates are:
Parsers.Options(::Union{Missing, Nothing, Array{String,1}}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Nothing, Char, UInt8, String}, ::Union{Char, UInt8}, ::Union{Nothing, Array{String,1}}, ::Union{Nothing, Array{String,1}}, ::Union{Nothing, String, Dates.DateFormat}, ::Any, ::Any, ::Any, ::Any, ::Any) at /home/js/.julia/packages/Parsers/GLY4Q/src/Parsers.jl:60
Parsers.Options(::Union{Missing, Nothing, Array{String,1}}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Nothing, Char, UInt8, String}, ::Union{Char, UInt8}, ::Union{Nothing, Array{String,1}}, ::Union{Nothing, Array{String,1}}, ::Union{Nothing, String, Dates.DateFormat}, ::Any, ::Any, ::Any, ::Any) at /home/js/.julia/packages/Parsers/GLY4Q/src/Parsers.jl:60
Parsers.Options(::Union{Missing, Nothing, Array{String,1}}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Char, UInt8}, ::Union{Nothing, Char, UInt8, String}, ::Union{Char, UInt8}, ::Union{Nothing, Array{String,1}}, ::Union{Nothing, Array{String,1}}, ::Union{Nothing, String, Dates.DateFormat}, ::Any, ::Any, ::Any) at /home/js/.julia/packages/Parsers/GLY4Q/src/Parsers.jl:60
Stacktrace:
[1] file(::String, ::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Int64, ::Bool, ::Nothing, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Array{String,1}, ::String, ::Nothing, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::UInt8, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Int8,Int8}, ::Bool, ::Float64, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing) at /home/js/.julia/packages/CSV/76SRf/src/CSV.jl:388
[2] #File#15(::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Int64, ::Bool, ::Nothing, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Array{String,1}, ::String, ::Nothing, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::UInt8, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Int8,Int8}, ::Bool, ::Float64, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing, ::Type{CSV.File}, ::String) at /home/js/.julia/packages/CSV/76SRf/src/CSV.jl:262
[3] CSV.File(::String) at /home/js/.julia/packages/CSV/76SRf/src/CSV.jl:262
[4] #read#70(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(CSV.read), ::String) at /home/js/.julia/packages/CSV/76SRf/src/CSV.jl:1156
[5] read(::String) at /home/js/.julia/packages/CSV/76SRf/src/CSV.jl:1156
[6] top-level scope at none:0
Am I doing something wrong here?
For the record: my Julia version is 1.3.1, package version of CSV is 0.6.1 and I am on a Linux system.
Output of ] st -m:
Status `~/.julia/environments/v1.3/Manifest.toml`
[1520ce14] AbstractTrees v0.3.3
[bf4720bc] AssetRegistry v0.1.0
[c52e3926] Atom v0.12.7
[b99e7846] BinaryProvider v0.5.9
[6e34b625] Bzip2_jll v1.0.6+2
[00ebfdb7] CSTParser v2.3.0
[336ed68f] CSV v0.6.1
[7057c7e9] Cassette v0.3.3
[324d7699] CategoricalArrays v0.7.7
[53a63b46] CodeTools v0.7.0
[da1fd8a2] CodeTracking v0.5.11
[3da002f7] ColorTypes v0.10.3
[5ae59095] Colors v0.12.0
[34da2185] Compat v3.9.0
[e66e0078] CompilerSupportLibraries_jll v0.3.3+0
[d38c429a] Contour v0.5.2
[9a962f9c] DataAPI v1.3.0
[a93c6f00] DataFrames v0.20.2
[864edb3b] DataStructures v0.17.15
[e2d170a0] DataValueInterfaces v1.0.0
[55939f99] DecFP v0.4.10
[b4f34e82] Distances v0.8.2
[33d173f1] DocSeeker v0.4.1
[c87230d0] FFMPEG v0.3.0
[b22a6f82] FFMPEG_jll v4.1.0+3
[5789e2e9] FileIO v1.3.0
[48062228] FilePathsBase v0.7.0
[53c48c17] FixedPointNumbers v0.8.0
[08572546] FlameGraphs v0.2.3
[d7e528f0] FreeType2_jll v2.10.1+2
[559328eb] FriBidi_jll v1.0.5+3
[de31a74c] FunctionalCollections v0.5.0
[28b8d3ca] GR v0.47.0
[4d00f742] GeometryTypes v0.7.6
[cd3eb016] HTTP v0.8.14
[9fb69e20] Hiccup v0.2.2
[9b13fd28] IndirectArrays v0.5.1
[83e8ac13] IniFile v0.5.0
[41ab1584] InvertedIndices v1.0.0
[c8e1da08] IterTools v1.3.0
[82899510] IteratorInterfaceExtensions v1.0.0
[682c06a0] JSON v0.21.0
[98e50ef6] JuliaFormatter v0.3.9
[aa1ae85d] JuliaInterpreter v0.7.14
[e5e0dc1b] Juno v0.8.0
[c1c5ebd0] LAME_jll v3.100.0+1
[7c4cb9fa] LNR v0.2.1
[50d2b5c4] Lazy v0.15.0
[1d6d02ad] LeftChildRightSiblingTrees v0.1.2
[dd192d2f] LibVPX_jll v1.8.1+1
[1914dd2f] MacroTools v0.5.5
[739be429] MbedTLS v1.0.2
[c8ffd9c3] MbedTLS_jll v2.16.0+2
[442fdcdd] Measures v0.3.1
[e89f7d12] Media v0.5.0
[e1d29d7a] Missings v0.4.3
[77ba4419] NaNMath v0.3.3
[be6f12e9] ODBC v0.9.0
[510215fc] Observables v0.3.1
[e7412a2a] Ogg_jll v1.3.4+0
[458c3c95] OpenSSL_jll v1.1.1+2
[efe28fd5] OpenSpecFun_jll v0.5.3+3
[91d4177d] Opus_jll v1.3.1+1
[bac558e1] OrderedCollections v1.2.0
[69de0a69] Parsers v1.0.3
[fa939f87] Pidfile v1.1.0
[b98c9c47] Pipe v1.2.0
[ccf2f8ad] PlotThemes v1.0.3
[995b91a9] PlotUtils v0.6.5
[91a5bcdd] Plots v0.29.3
[2dfb63ee] PooledArrays v0.5.3
[3cdcf5f2] RecipesBase v0.8.0
[189a3867] Reexport v0.2.0
[ae029012] Requires v1.0.1
[1277b4bf] ShiftedArrays v1.0.0
[992d4aef] Showoff v0.3.1
[a2af1166] SortingAlgorithms v0.3.1
[276daf66] SpecialFunctions v0.9.0
[90137ffa] StaticArrays v0.12.3
[2913bbd2] StatsBase v0.32.2
[88034a9c] StringDistances v0.6.4
[3783bdb8] TableTraits v1.0.0
[bd369af6] Tables v1.0.4
[0796e94c] Tokenize v0.5.8
[37b6cedf] Traceur v0.3.0
[a2a6695c] TreeViews v0.3.0
[30578b45] URIParser v0.4.1
[ea10d353] WeakRefStrings v0.6.2
[0f1e0344] WebIO v0.8.11
[104b5d7c] WebSockets v1.5.2
[cc8bc4a8] Widgets v0.6.2
[83775a58] Zlib_jll v1.2.11+9
[0ac62f75] libass_jll v0.14.0+2
[f638f0a6] libfdk_aac_jll v0.1.6+2
[f27f6e37] libvorbis_jll v1.3.6+4
[1270edf5] x264_jll v2019.5.25+2
[dfaa095f] x265_jll v3.0.0+1
[2a0f44e3] Base64
[ade2ca70] Dates
[8bb1440f] DelimitedFiles
[8ba89e20] Distributed
[7b1f6079] FileWatching
[9fa8497b] Future
[b77e0a4c] InteractiveUtils
[76f85450] LibGit2
[8f399da3] Libdl
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[d6f4376e] Markdown
[a63ad114] Mmap
[44cfe95a] Pkg
[de0858da] Printf
[9abbd945] Profile
[3fa0cd96] REPL
[9a3f8284] Random
[ea8e919c] SHA
[9e88b42a] Serialization
[1a1011a3] SharedArrays
[6462fe0b] Sockets
[2f01184e] SparseArrays
[10745b16] Statistics
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode
Update the package:
using Pkg
pkg"update"
pkg"precompile"
Explanation
CSV.jl version has been realeased with read not quite working (see https://github.com/JuliaData/CSV.jl/issues/588)
Either updating to 0.6.2 or downgrading to 0.5.26 (when you are not able to update) should work like a charm.
I try to send an email using the R package blastula.
The email should be sent though my employers secure smtp server, but I am stuck with the error "No Kerberos credentials available".
A similar setup works in python, but I would like to do it from R, as it fits my workflow better.
The r code used to send the mail, is shown here.
library(blastula)
email <- prepare_test_message()
to <- "receiver_address#gmail.com"
from <- "sender_address#domain.com"
create_smtp_creds_file(
file = "cred_file",
user = "username",
host = "smtps.server.com",
port = 465,
use_ssl = TRUE
)
#> Please enter password in TK window (Alt+Tab)
#> The SMTP credentials file (`cred_file`) has been generated
smtp_send(email, to, from,
subject = "Hello",
credentials = creds_file(file = "cred_file"),
verbose = TRUE)
#> Error in curl::curl_fetch_memory(url, handle = h): Failure when receiving data from the peer
Created on 2019-12-10 by the reprex package (v0.3.0)
The verbose output from the smtp_send command is given here:
* Rebuilt URL to: smtps://smtps.server.com:465/
* Trying xx.xx.xx.xx...
* TCP_NODELAY set
* Connected to smtps.server.com (xx.xx.xx.xx) port 465 (#1)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
* subject: XXXXXXXX
* start date: Apr 20 00:00:00 2017 GMT
* expire date: Apr 23 12:00:00 2020 GMT
* subjectAltName: host "smtps.server.com" matched cert's "smtps.server.com"
* issuer: C=NL; ST=Noord-Holland; L=Amsterdam; O=TERENA; CN=TERENA SSL CA 3
* SSL certificate verify ok.
< 220 mail.server.com Microsoft ESMTP MAIL Service ready at Tue, 10 Dec 2019 12:49:44 +0100
> EHLO henrik-HP-EliteBook-840-G5
< 250-mail.sdu.dk Hello [xx.xx.xx.xx]
< 250-SIZE 62914560
< 250-PIPELINING
< 250-DSN
< 250-ENHANCEDSTATUSCODES
< 250-STARTTLS
< 250-AUTH GSSAPI NTLM LOGIN
< 250-8BITMIME
< 250-BINARYMIME
< 250 CHUNKING
> AUTH GSSAPI
< 334 GSSAPI supported
* gss_init_sec_context() failed: No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_501).
* Closing connection 1
Error in curl::curl_fetch_memory(url, handle = h) :
Failure when receiving data from the peer
And output from sessionInfo()
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] blastula_0.3.1.9000
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 compiler_3.6.1 prettyunits_1.0.2 remotes_2.1.0 tools_3.6.1 getPass_0.2-2
[7] testthat_2.3.1 digest_0.6.23 pkgbuild_1.0.6 uuid_0.1-2 pkgload_1.0.2 jsonlite_1.6
[13] memoise_1.1.0 rlang_0.4.2 cli_2.0.0 rstudioapi_0.10 commonmark_1.7 curl_4.3
[19] yaml_2.2.0 xfun_0.11 withr_2.1.2 stringr_1.4.0 knitr_1.26 fs_1.3.1
[25] desc_1.2.0 devtools_2.2.1 rprojroot_1.3-2 glue_1.3.1 R6_2.4.1 processx_3.4.1
[31] fansi_0.4.0 sessioninfo_1.1.1 callr_3.4.0 magrittr_1.5 usethis_1.5.1 backports_1.1.5
[37] ps_1.3.0 ellipsis_0.3.0 htmltools_0.4.0 assertthat_0.2.1 stringi_1.4.3 crayon_1.3.4
This looks identical to an error I received while trying to use SendGrid as the SMTP service. The issue was not with blastula, but with the fact that I had not verified a "Single Sender Identity".
In the SendGrid UI you will find "Sender Authentication" under settings. Verify the address that you will use as the from address in you blastula message. Once you have clicked on the verification email that you receive in your inbox send again from blastula. The message should now be delivered without issues.
We have a web based application developed using the .NET framework 4 and ASP.NET MVC.When you set an item to a session in a section of the code, we are faced with an internal exception directly from mscorlib which causes our application to work unexpectedly.The fault stack trace is as follows;
0:072> !clrstack
OS Thread Id: 0x31ec (72)
Child SP IP Call Site
000000aea766d968 000007f9736a4650 [HelperMethodFrame: 000000aea766d968]
000000aea766da50 000007f9674e0e5a System.Collections.ArrayList.Add(System.Object)
000000aea766da90 000007f966655292 System.Collections.Specialized.NameObjectCollectionBase.BaseAdd(System.String, System.Object)
000000aea766dae0 000007f9650ac4c9 System.Web.SessionState.SessionStateItemCollection.set_Item(System.String, System.Object)
000000aea766db20 000007f90ed89ce9 UTL.WebStateManager.set_Item(System.String, System.Object)
000000aea766dbf0 000007f90f29370c WebStateManagerHelper.get_OriginalPNR()
000000aea766dc80 000007f90f29242d QueryDynamicLoggingComponent.LogTransaction(System.String, System.String)
000000aea766e110 000007f90f2917e3 WSHelper.Log(System.String, System.String, Boolean, System.String)
000000aea766e160 000007f90f28fd17 WSHelper.GetResponse(System.String, SecurityInfo, System.String, System.String, System.String ByRef, System.String, System.String)
000000aea766e5d0 000007f90f29eae6 WSHelper.SendQuery(System.String, SecurityInfo, System.String)
000000aea766e7f0 000007f90f29e7f8 WSHelper.SendQuery(SecurityInfo, System.String)
000000aea766e840 000007f90f29e4af APIWSPool.SendAndReceiveQueryToString(Agency, System.String, Token, Boolean)
000000aea766e940 000007f90f29e374 APIWSPool.SendAndReceiveQuery(Agency, Token, Boolean)
000000aea766e9b0 000007f90f6168f4 FlightBookingManager.SearchFlightForMPSearchedFlightRecommendations1(Agency, FlightFareDrivenSearchInfo, Boolean)
000000aea766eb80 000007f90f615ec1 ApiFlightBookingProvider.SearchFlightForMPSearchedFlightRecommendations1(Agency, FlightFareDrivenSearchInfo, Boolean)
000000aea766ebe0 000007f90f6158f2 APICOM.Threading.OWCOutboundSearchThread.Work()
000000aea766edb0 000007f9674e2d45 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
000000aea766ef10 000007f9674e2ab9 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
000000aea766ef40 000007f9674e2a97 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
000000aea766ef90 000007f9674fa161 System.Threading.ThreadHelper.ThreadStart()
000000aea766f2a8 000007f96e0eab53 [GCFrame: 000000aea766f2a8]
000000aea766f5f8 000007f96e0eab53 [DebuggerU2MCatchHandlerFrame: 000000aea766f5f8]
000000aea766f788 000007f96e0eab53 [ContextTransitionFrame: 000000aea766f788]
000000aea766f9a8 000007f96e0eab53 [DebuggerU2MCatchHandlerFrame: 000000aea766f9a8]
When I run !dso in the thread I am receiving the error and look at the ArrayList that the Session uses, I can't see any problem.
0:072> !DumpObj /d 000000adb1348540
Name: System.Collections.ArrayList
MethodTable: 000007f967727868
EEClass: 000007f967109b60
Size: 40(0x28) bytes
File: C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
Fields:
MT Field Offset Type VT Attr Value Name
000007f9676b31c0 4000c2f 8 System.Object[] 0 instance 000000abf0b6ec10 _items
000007f967722238 4000c30 18 System.Int32 1 instance 17 _size
000007f967722238 4000c31 1c System.Int32 1 instance 17 _version
000007f96771fca0 4000c32 10 System.Object 0 instance 0000000000000000 _syncRoot
000007f9676b31c0 4000c33 5e8 System.Object[] 0 shared static emptyArray
>> Domain:Value 000000ab6a93ba10:000000ac6b0b23c0 000000aea416c820:000000ac2b1f8730 <<
0:072> !DumpObj /d 000000abf0b6ec10
Name: System.Object[]
MethodTable: 000007f9676b31c0
EEClass: 000007f9671078f8
Size: 288(0x120) bytes
Array: Rank 1, Number of elements 32, Type CLASS (Print Array)
Fields:
None
0:072> !DumpArray /d 000000abf0b6ec10
Name: System.Object[]
MethodTable: 000007f9676b31c0
EEClass: 000007f9671078f8
Size: 288(0x120) bytes
Array: Rank 1, Number of elements 32, Type CLASS
Element Methodtable: 000007f96771fca0
[0] 000000adb1348b90
[1] 000000adb1348c08
[2] 000000adb137e268
[3] 000000adb137e348
[4] 000000adb137e5c8
[5] 000000adb137e6b0
[6] 000000adb137e8d0
[7] 000000adb137ea98
[8] 000000adb137eb48
[9] 000000adb13f57d8
[10] 000000adb13f5a78
[11] 000000adb13f5b08
[12] 000000adb13f9018
[13] 000000adb13f9470
[14] 000000adb14b7618
[15] 000000abf0b6e4d8
[16] 000000abf0b6ebf0
[17] null
[18] null
[19] null
[20] null
[21] null
[22] null
[23] null
[24] null
[25] null
[26] null
[27] null
[28] null
[29] null
[30] null
[31] null
We know that the Session is not thread-safe for some operations.When we analyzed dumps we didn't see any other thread trying to access the same session object.We checked the source code of .NET in referencesource.microsoft.com and we think that it is a related an error indexing the internal array of the ArrayList.I'm not sure, but it seems to have a memory problem.Any ideas?