Skip to content
Prev 15093 / 15274 Next

Error with getSymbols('SP500', from = "2020-01-01", to = "2021-06-30", src='FRED') SP500<-na.locf(SP500, na.rm = TRUE)

I run the program from a batch file with this command:

"C:\Program Files\R\R-4.2.2\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Projects\S&P_500_FRED\S&P_500.txt" "C:\Users\Frank\Documents\R\Projects\S&P_500_FRED\S&P_500.out"

The session info is:


R version 4.2.2 (2022-10-31 ucrt) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]
Loading required package: xts
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: TTR
Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] chron_2.3-58    quantmod_0.4.20 TTR_0.24.3      xts_0.12.2     
[5] zoo_1.8-11     

loaded via a namespace (and not attached):
[1] compiler_4.2.2  curl_4.3.3      grid_4.2.2      lattice_0.20-45
-----Original Message-----
From: Frank 
Sent: Monday, November 07, 2022 12:19 PM
To: 'Daniel Cegie?ka' <daniel.cegielka at gmail.com>; 'Joshua Ulrich' <josh.m.ulrich at gmail.com>
Cc: 'r-sig-finance at r-project.org' <r-sig-finance at r-project.org>
Subject: RE: [R-SIG-Finance] Error with getSymbols('SP500', from = "2020-01-01", to = "2021-06-30", src='FRED') SP500<-na.locf(SP500, na.rm = TRUE)

I upgraded to R 4.2.2. I also installed quantmod, TTR, chron and a few other packages. I'm getting the same 

Error in getSymbols.FRED(Symbols = "SP500", env = <environment>, verbose = FALSE,  : 
  Unable to import "SP500".
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed).
Calls: getSymbols -> do.call -> getSymbols.FRED Execution halted

Error message. I was running code last week that had been upgraded for the switch from http: to https: on FRED. Probably r 4.0.5.

Thanks,

Frank
Chicago

-----Original Message-----
From: Daniel Cegie?ka
Sent: Monday, November 07, 2022 10:45 AM
To: Joshua Ulrich <josh.m.ulrich at gmail.com>
Cc: Frank <frankm60606 at gmail.com>; r-sig-finance at r-project.org
Subject: Re: [R-SIG-Finance] Error with getSymbols('SP500', from = "2020-01-01", to = "2021-06-30", src='FRED') SP500<-na.locf(SP500, na.rm = TRUE)

Hi Josh,

schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE
(0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed).

This looks like a problem (not a bug in getSymbols) with the TLS cipher suites. Try direct curl/libcurl. I think you will get the same error.

Best,
Daniel

pon., 7 lis 2022 o 17:33 Joshua Ulrich <josh.m.ulrich at gmail.com> napisa?(a):