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.
Related
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.
I am facing the below error in WSO2 IS 5.9.0.
We are using WSO2 IS in an AWS environment.
WSO2 Node Cloud EC2 Instance Type - t2.small
MySQL Cloud EC2 Instance Type - t2.small
WSO2 Version - 5.9.0
Current Architecture-
2 x WSO2 Node
1 x MySQL Database
1 x Application Load Balancer
Attached WSO2 Carbon logs.
TID: [23] [] [2021-02-06 05:12:39,898] [ef8de62b-0cd7-491a-879a-0eb7305b2e15] INFO {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder} - Initializing of policy store is started at : Sat Feb 06 05:12:39 UTC 2021
TID: [23] [] [2021-02-06 05:12:39,904] [ef8de62b-0cd7-491a-879a-0eb7305b2e15] INFO {org.wso2.carbon.identity.entitlement.policy.store.DefaultPolicyDataStore} - Using Global policy combining algorithm that is defined in configuration file.
TID: [23] [] [2021-02-06 05:12:39,904] [ef8de62b-0cd7-491a-879a-0eb7305b2e15] INFO {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder} - Start retrieving policies from org.wso2.carbon.identity.entitlement.policy.store.RegistryPolicyStoreManageModule#7303cb2f at : Sat Feb 06 05:12:39 UTC 2021
TID: [23] [] [2021-02-06 05:12:39,910] [ef8de62b-0cd7-491a-879a-0eb7305b2e15] INFO {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder} - Finish retrieving policies from org.wso2.carbon.identity.entitlement.policy.store.RegistryPolicyStoreManageModule#7303cb2f at : Sat Feb 06 05:12:39 UTC 2021
TID: [23] [] [2021-02-06 05:12:39,910] [ef8de62b-0cd7-491a-879a-0eb7305b2e15] INFO {org.wso2.carbon.identity.entitlement.policy.finder.CarbonPolicyFinder} - Initializing of policy store is finished at : Sat Feb 06 05:12:39 UTC 2021
TID: [-1] [] [2021-02-06 08:00:41,235] [] ERROR {org.wso2.carbon.humantask.core.scheduler.SimpleScheduler} - Error loading immediate jobs from database. <openjpa-2.2.0-wso2v1-r128166:129108 fatal general error> org.apache.openjpa.persistence.PersistenceException: Database may be already in use: "Waited for database closing longer than 1 minute". Possible solutions: close all other connection(s); use the server mode [90020-199]
FailedObject: SELECT DISTINCT t FROM org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.HumanTaskJob t WHERE t.nodeId = ?1 AND t.time < ?2 order by t.time [java.lang.String]
at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4918)
at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4878)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:110)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:949)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getConnection(JDBCStoreManager.java:240)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:413)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:382)
at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286)
at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
at org.wso2.carbon.humantask.core.dao.jpa.openjpa.HumanTaskDAOConnectionImpl.dequeueImmediate(HumanTaskDAOConnectionImpl.java:248)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$2.call(SimpleScheduler.java:344)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$2.call(SimpleScheduler.java:342)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.execTransaction(SimpleScheduler.java:879)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.execTransaction(SimpleScheduler.java:828)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.doLoadImmediate(SimpleScheduler.java:342)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$LoadImmediateTask.run(SimpleScheduler.java:297)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$1.call(SimpleScheduler.java:149)
at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$1.call(SimpleScheduler.java:146)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database may be already in use: "Waited for database closing longer than 1 minute". Possible solutions: close all other connection(s); use the server mode [90020-199]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:617)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.engine.Engine.openSession(Engine.java:209)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178)
at org.h2.engine.Engine.createSession(Engine.java:161)
at org.h2.engine.Engine.createSession(Engine.java:31)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148)
at org.h2.Driver.connect(Driver.java:69)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:739)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:671)
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:198)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:132)
at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:960)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:945)
... 25 more
My WSO2 Configuration(deployement.toml file)-
[server]
hostname = "localhost"
node_ip = "127.0.0.1"
base_path = "https://$ref{server.hostname}:${carbon.management.port}"
[super_admin]
username = "username#wso2.com"
password = "password"
create_admin_account = true
[tenant_mgt]
enable_email_domain= true
[user_store]
type = "database"
scim_enabled = true
user_name_attribute = "mail"
username_java_script_regex = '^[a-zA-Z0-9.-_]+#[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$'
username_java_regex='^[a-zA-Z0-9.-_]+#[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}'
[database.identity_db]
type = "mysql"
url= "jdbc:mysql://<SOME_IP>:3306/regdb?useSSL=false"
username = "<SOME_USER>"
password = "<SOME_PASSWORD>"
driver = "com.mysql.jdbc.Driver"
[database.shared_db]
type = "mysql"
url= "jdbc:mysql://<SOME_IP>:3306/regdb?useSSL=false"
username = "<SOME_USER>"
password = "<SOME_PASSWORD>"
driver = "com.mysql.jdbc.Driver"
[[cache.manager]]
name = "LocalClaimInvalidationCache"
timeout = "300"
capacity = "5000"
[carbon_health_check]
enable= true
[keystore.primary]
name = "wso2carbon.jks"
password = "wso2carbon"
[admin_service.wsdl]
enable = true
authentication.authenticator.session_handler.parameters.max_session_count = "100"
In Genie (http://genieframework.com/),
I try to create a new resource names 'Toto' using the command
./bin/repl --resource:new=Toto
I get the following error :
ERROR: LoadError: UndefVarError: SearchLight not defined
execute(::Genie.Configuration.Settings) at /home/vlaugier/.julia/v0.6/Genie/src/Commands.jl:38
run() at /home/vlaugier/.julia/v0.6/Genie/src/Genie.jl:52
eval(::Module, ::Any) at ./boot.jl:235
eval_ew_expr at ./distributed/macros.jl:116 [inlined]
(::Base.Distributed.##135#136{Base.Distributed.#eval_ew_expr,Tuple{Expr},Array{Any,1}})() at ./distributed/remotecall.jl:314
run_work_thunk(::Base.Distributed.##135#136{Base.Distributed.#eval_ew_expr,Tuple{Expr},Array{Any,1}}, ::Bool) at ./distributed/process_messages.jl:56
#remotecall_fetch#140(::Array{Any,1}, ::Function, ::Function, ::Base.Distributed.LocalProcess, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:339
remotecall_fetch(::Function, ::Base.Distributed.LocalProcess, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:339
#remotecall_fetch#144(::Array{Any,1}, ::Function, ::Function, ::Int64, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:367
remotecall_fetch(::Function, ::Int64, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:367
(::##13#15)() at ./distributed/macros.jl:102
#remotecall_fetch#140(::Array{Any,1}, ::Function, ::Function, ::Base.Distributed.LocalProcess, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:340
remotecall_fetch(::Function, ::Base.Distributed.LocalProcess, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:339
#remotecall_fetch#144(::Array{Any,1}, ::Function, ::Function, ::Int64, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:367
remotecall_fetch(::Function, ::Int64, ::Expr, ::Vararg{Expr,N} where N) at ./distributed/remotecall.jl:367
(::##13#15)() at ./distributed/macros.jl:102
sync_end() at ./task.jl:287
macro expansion at ./distributed/macros.jl:112 [inlined]
anonymous at ./<missing>:?
include_from_node1(::String) at ./loading.jl:576
include(::String) at ./sysimg.jl:14
(::Base.Distributed.##135#136{Base.#include,Tuple{String},Array{Any,1}})() at ./distributed/remotecall.jl:314
run_work_thunk(::Base.Distributed.##135#136{Base.#include,Tuple{String},Array{Any,1}}, ::Bool) at ./distributed/process_messages.jl:56
#remotecall_fetch#140(::Array{Any,1}, ::Function, ::Function, ::Base.Distributed.LocalProcess, ::String, ::Vararg{String,N} where N) at ./distributed/remotecall.jl:339
remotecall_fetch(::Function, ::Base.Distributed.LocalProcess, ::String, ::Vararg{String,N} where N) at ./distributed/remotecall.jl:339
#remotecall_fetch#144(::Array{Any,1}, ::Function, ::Function, ::Int64, ::String, ::Vararg{String,N} where N) at ./distributed/remotecall.jl:367
remotecall_fetch(::Function, ::Int64, ::String, ::Vararg{Any,N} where N) at ./distributed/remotecall.jl:367
(::Base.##507#509{Base.JLOptions})() at ./task.jl:335
while loading /home/vlaugier/CODE/sandbag/julia/genie/first_app_in_genie/genie.jl, in expression starting on line 32
#remotecall_fetch#140(::Array{Any,1}, ::Function, ::Function, ::Base.Distributed.LocalProcess, ::String, ::Vararg{String,N} where N) at ./distributed/remotecall.jl:340
remotecall_fetch(::Function, ::Base.Distributed.LocalProcess, ::String, ::Vararg{String,N} where N) at ./distributed/remotecall.jl:339
#remotecall_fetch#144(::Array{Any,1}, ::Function, ::Function, ::Int64, ::String, ::Vararg{String,N} where N) at ./distributed/remotecall.jl:367
remotecall_fetch(::Function, ::Int64, ::String, ::Vararg{Any,N} where N) at ./distributed/remotecall.jl:367
(::Base.##507#509{Base.JLOptions})() at ./task.jl:335
Stacktrace:
[1] sync_end() at ./task.jl:287
[2] macro expansion at ./task.jl:303 [inlined]
[3] process_options(::Base.JLOptions) at ./client.jl:279
[4] _start() at ./client.jl:371
Nevertheless some files are created :
app/resources/totos/TotosController.jl
app/resources/totos/TotosChannel.jl
app/resources/totos/authorization.yml
test/unit/totos_test.jl
My version of Julia is the following :
julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-3520M CPU # 2.90GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, ivybridge)
Sorry for that, it seems that the process of extracting the SearchLight ORM out of Genie broke the Commands module. I pushed a quick fix for this, you'll get it when you run Pkg.update().
However, this is no longer the recommended way to interact with Genie's generator features. Instead, start a Genie REPL ($> ./bin/repl) and then use the methods exposed by the various modules. Every piece of functionality provided at the shell is available under:
Genie.Generator (new_resource, new_controller, new_channel)
SearchLight.Generator (db_init, new_model, new_migration)
Migration
Toolbox
AppServer
The Commands module is left for historical reasons - and because it seemed a good way to help with feature discovery, lacking extensive documentation. Once better docs become available, more such early features will be removed or refactored/reorganized.
Finally, for any other bugs, please open an issue in Genie's GitHub repo.
I'm using RSelenium to construct a data frame with information about managers. I have problem to select an element in a drop-down list.
My code is the following:
> require(RSelenium)
> remDr<-remoteDriver(browserName = "chrome")
> remDr$open()
> enlace<-'https://www.sisben.gov.co/atencion-al-ciudadano/Paginas/Directorio-administradores.aspx'
> remDr$navigate(enlace)
> remDr$findElement(using = "xpath", '//*[#id="ddlDepartamento"]/option[2]')$clickElement()
With the last line, I obtain the following error:
Selenium message:no such element: Unable to locate element: {"method":"xpath","selector":"//*[#id="ddlMunicipio"]"}
(Session info: chrome=58.0.3029.110)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 140 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.2.0', revision: '8c03df6', time: '2017-03-02 09:34:51 -0800'
System info: host: 'PATY-FRAN', ip: '192.168.0.20', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=C:\Users\victor\AppData\Local\Temp\scoped_dir6076_6551}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=58.0.3029.110, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 0815f4f9dcca9d364a7c15b4a50352e7
*** Element info: {Using=xpath, value=//*[#id="ddlMunicipio"]}
Error: Summary: NoSuchElement
Detail: An element could not be located on the page using the given search parameters.
class: org.openqa.selenium.NoSuchElementException
Further Details: run errorDetails method
I will be grateful with your help.
The content is in an iframe. You need to switch to the iframe first:
library(RSelenium)
rD<-rsDriver()
remDr <- rD$client
enlace<-'https://www.sisben.gov.co/atencion-al-ciudadano/Paginas/Directorio-administradores.aspx'
remDr$navigate(enlace)
# content is in iframe
frames <- remDr$findElements("css", "iframe")
# switch to first iframe
remDr$switchToFrame(frames[[1]])
selectElem <- remDr$findElement("id", "ddlDepartamento")
selectOpt <- selectElem$selectTag()
> selectOpt$text
[1] "AMAZONAS" "ANTIOQUIA" "ARAUCA" "ATLANTICO"
[5] "BOGOTÁ D.C." "BOLIVAR" "BOYACA" "CALDAS"
[9] "CAQUETA" "CASANARE" "CAUCA" "CESAR"
[13] "CHOCO" "CORDOBA" "CUNDINAMARCA" "GUAINIA"
[17] "GUAJIRA" "GUAVIARE" "HUILA" "MAGDALENA"
[21] "META" "NARIÑO" "NORTE DE SANTANDER" "PUTUMAYO"
[25] "QUINDIO" "RISARALDA" "SAN ANDRES" "SANTANDER"
[29] "SUCRE" "TOLIMA" "VALLE" "VAUPES"
[33] "VICHADA"
# click 2nd one
selectOpt$elements[[2]]$clickElement()
....
....
rm(rD)
gc()
Does anyone have experience with the limitations of postForm from the RCurl package?
I am pulling data off an server and almost out of nowhere I got the error message * HTTP 1.0, assume close after body and then a 500 Internal Server Error. I tested the configurations and everything seemed to be fine. I've created a clean database and re-uploaded my database 20/30 cases at the time while repeatedly pulling the data with an API/postForm call from R. It all works as it should until I get to around 150 cases then the error message appears. Regardless of the order I upload the cases in the error appears around 150/160 cases and a total files size around 11 to 12 MB. In other words, the error doesn't seem to be dependent on specific cases as it is not the same cases that breaks it
Any advice would be appreciated.
I've attached a screenshot to spice up this rather boring post a bit and to make up for not having a working example,
Update 2013-08-24 19:33:18Z
Here my curlVersion()$version and sessionInfo() information,
> curlVersion()$version
[1] "7.22.0"
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] 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
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.1 bitops_1.0-6
Update 2013-08-26 05:39:26Z
As suggested in hadley's comment I've added the verbose RCurl output from the call that works and from the call that fails, see below
The call that works with less then 150 cases in the database
> R.object.API <- postForm(R.object.URL, token=R.object.token, content="record", type="flat", format="csv", rawOrLabel="Label", .opts=curlOptions(ssl.verifypeer=TRUE, cainfo=R.object.crt, verbose=TRUE))
* About to connect() to research.org port 443 (#0)
* Trying xx.xx.xxx.xxx... * connected
* successfully set certificate verify locations:
* CAfile: /home/dir/research.cert
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=XX; postalCode=XXXXX-XXXX; ST=XX; L=XXXXXX; street=XXX; street=XX XXXXXX XX; O=XXXX, XXX; OU=XXX; CN=research.org
* start date: 2013-02-04 00:00:00 GMT
* expire date: 2016-02-04 23:59:59 GMT
* subjectAltName: research.org matched
* issuer: C=US; O=XXXXXX; OU=XXXXXX; CN=XXXXXX Server XX
* SSL certificate verify ok.
> POST /api/ HTTP/1.1
Host: research.org
Accept: */*
Content-Length: 573
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------XXXXXXXXXXXX
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Mon, 26 Aug 2013 05:16:44 GMT
< Server: Apache/2.2.15 (Red Hat)
< X-Powered-By: PHP/5.3.3
< Expires: 0
< cache-control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
<
* Closing connection #0
>
The call fails with more then 150 cases in the database
> R.object.API <- postForm(R.object.URL, token=R.object.token, content="record", type="flat", format="csv", rawOrLabel="Label", .opts=curlOptions(ssl.verifypeer=TRUE, cainfo=R.object.crt, verbose=TRUE))
* About to connect() to research.org port 443 (#0)
* Trying xx.xx.xxx.xxx... * connected
* successfully set certificate verify locations:
* CAfile: /home/dir/research.cert
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=XX; postalCode=XXXXX-XXXX; ST=XX; L=XXXXXX; street=XXX; street=XX XXXXXX XX; O=XXXX, XXX; OU=XXX; CN=research.org
* start date: 2013-02-04 00:00:00 GMT
* expire date: 2016-02-04 23:59:59 GMT
* subjectAltName: research.org matched
* issuer: C=US; O=XXXXXX; OU=XXXXXX; CN=XXXXXX Server XX
* SSL certificate verify ok.
> POST /api/ HTTP/1.1
Host: research.org
Accept: */*
Content-Length: 573
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------XXXXXXXXXXXX
< HTTP/1.1 100 Continue
* HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Date: Mon, 26 Aug 2013 05:15:05 GMT
< Server: Apache/2.2.15 (Red Hat)
< X-Powered-By: PHP/5.3.3
< Expires: 0
< cache-control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Content-Length: 276
< Connection: close
< Content-Type: text/html; charset=UTF-8
<
* Closing connection #0
Error: Internal Server Error
Doesnt answer your question but relates to options and keepalive:
RCurl uses the libcurl library. This is different to the CURL command line tool. You need to look at the libcurl options here. CURLOPT_TCP_KEEPALIVE maybe what you want. In RCurl this would be listed as tcp.keepalive if it were present in listCurlOptions().
From the easyopt man page this was added in 7.25.0. You can check what version of libcurl RCurl is using by running
> curlVersion()$version
[1] "7.22.0"
Unfortunately the version of libcurl RCurl is using doesnt handle the keep alives yet.
Putting this in an answer as it's easier to format. My suggestion is to save the following in a file, fill in the form address (i.e change WHEREVER_YOU_ARE_TRYING_TO_POST_DATA to the appropriate address), name it something like test.html, and open it in your browser.
I've filled in most of the values based upon your above examples, but I have no idea what should go in the token field - this depends upon your specific problem.
<!DOCTYPE html>
<html>
<head></head>
<body>
<div class="content">
<form action="WHEREVER_YOU_ARE_TRYING_TO_POST_DATA" method="post">
token: <input name="token" type="text" size="100" /><br />
content: <input name="content" type="text" size="100" value="record" /><br />
type: <input name="type" type="text" size="100" value="flat"/><br />
format: <input name="format" type="text" size="100" value="csv"/><br />
rawOrLabel: <input name="rawOrLabel" type="text" size="100" value="Label"/><br />
<input name="Submit" type="submit" value="submit" />
</form>
</div>
</body>
</html>
If submitting this form works, but your postForm code doesn't, then something weird is going on with your R code. If they both fail then you have a much deeper problem that probably has nothing to do with R.