locked
Unable to identify current timezone. RRS feed

  • Question

  • Hi, all,

    I am using R on the Azure machine learning, and I have some problems.

    I want to use program R to calculate the difference between two date, for example, 2014/11/01 and 2014/11/03.

    I using the function "strptime" in R to do this thing, it can work on my own computer, but when I want to run the same code on Azure ml, it came out the error.

    The error is : 

    [ModuleOutput] 1: In strptime(x, format, tz = tz) :
    [ModuleOutput] 
    [ModuleOutput]   unable to identify current timezone 'C':
    [ModuleOutput] 
    [ModuleOutput] please set environment variable 'TZ'
    [ModuleOutput] 
    [ModuleOutput] 2: In strptime(x, format, tz = tz) : unknown timezone 'localtime'

    I think the problem is that it can't detect the timezone on Azure ml, but I'm not sure.

    Is there any way to solve this problem?

    Thanks in advance.


    • Edited by KS Tseng Thursday, November 6, 2014 8:18 AM
    Thursday, November 6, 2014 8:18 AM

Answers

  • Thank you very much!

    After your recommendation, I went back to check my data.

    I found that some of my columns have some missing values, I think that's the reason why Azure will regarded it as string.

    Thanks a lot!! 

    • Proposed as answer by neerajkh_MSFT Tuesday, February 3, 2015 7:39 AM
    • Marked as answer by neerajkh_MSFT Tuesday, February 3, 2015 7:39 AM
    Tuesday, November 11, 2014 1:48 AM

All replies

  • Hello!

    Am I correct in assuming the above is actually a set of warnings from R rather than errors? Could you please paste the full output log from the script execution?

    You're correct about the timezone defect (The TZ is unavailable to the R interpreter on our VMs), but you can work around the issue by manually providing TZ (excerpt from here):

    ## time zones name are not portable, but 'EST5EDT' comes pretty close.
    (x <- strptime(c("2006-01-08 10:07:52", "2006-08-07 19:33:02"),
                   "%Y-%m-%d %H:%M:%S", tz = "EST5EDT"))

    Thursday, November 6, 2014 7:24 PM
  • Thanks for your reply!

    In these days I found the key point why my R code can't run on MS Azure.

    I upload the data which contain the "Date" form. 

    For example, I upload the data which contain 2 columns, 1st column is c("2014/11/01", "2014/11/02"), and the second column is c("2014/10/01", "2014/10/02")

    MS Azure will only change my first column to the timezone form automatically, like 2014-11-01T00:00:00 and 2014-11-02T00:00:00 , and the elements in second column are still the same. 

    That's the reason why I can't calculate the difference between these 2 columns, but I don't know why.

    Here is the full output log

    Record Starts at UTC 11/10/2014 02:42:21:
    
    Run the job:"/dll "ExecuteRScript, Version=5.1.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset"  /dataset1 "..\..\Dataset1\Dataset1.csv"    /bundlePath "..\..\Script Bundle\Script Bundle.zip"  /rStreamReader "script.R"  "
    Starting process 'C:\Resources\directory\275cc759e61f4dbf889cde5e5cba0835.SingleNodeRuntimeCompute.Packages\AFx\5.1\DllModuleHost.exe' with arguments ' /dll "ExecuteRScript, Version=5.1.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset"  /dataset1 "..\..\Dataset1\Dataset1.csv"    /bundlePath "..\..\Script Bundle\Script Bundle.zip"  /rStreamReader "script.R"  '
    [ModuleOutput] DllModuleHost Start: 1 : Program::Main
    [ModuleOutput]   DllModuleHost Start: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString
    [ModuleOutput]   DllModuleHost Stop: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString. Duration: 00:00:00.0051035
    [ModuleOutput]   DllModuleHost Start: 1 : DllModuleMethod::DllModuleMethod
    [ModuleOutput]   DllModuleHost Stop: 1 : DllModuleMethod::DllModuleMethod. Duration: 00:00:00.0000604
    [ModuleOutput]   DllModuleHost Start: 1 : DllModuleMethod::Execute
    [ModuleOutput]     DllModuleHost Start: 1 : DataLabModuleBinder::BindModuleMethod
    [ModuleOutput]       DllModuleHost Verbose: 1 : moduleMethodDescription ExecuteRScript, Version=5.1.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run
    [ModuleOutput]       DllModuleHost Verbose: 1 : assemblyFullName ExecuteRScript, Version=5.1.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
    [ModuleOutput]       DllModuleHost Start: 1 : DataLabModuleBinder::LoadModuleAssembly
    [ModuleOutput]         DllModuleHost Verbose: 1 : Trying to resolve assembly : ExecuteRScript, Version=5.1.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
    [ModuleOutput]         DllModuleHost Verbose: 1 : Loaded moduleAssembly ExecuteRScript, Version=5.1.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
    [ModuleOutput]       DllModuleHost Stop: 1 : DataLabModuleBinder::LoadModuleAssembly. Duration: 00:00:00.0072540
    [ModuleOutput]       DllModuleHost Verbose: 1 : moduleTypeName Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript
    [ModuleOutput]       DllModuleHost Verbose: 1 : moduleMethodName Run
    [ModuleOutput]       DllModuleHost Information: 1 : Module FriendlyName : Execute R Script
    [ModuleOutput]       DllModuleHost Information: 1 : Module Release Status : Release
    [ModuleOutput]     DllModuleHost Stop: 1 : DataLabModuleBinder::BindModuleMethod. Duration: 00:00:00.0112076
    [ModuleOutput]     DllModuleHost Start: 1 : ParameterArgumentBinder::InitializeParameterValues
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos count = 5
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[0] name = dataset1 , type = Microsoft.Numerics.Data.Local.DataTable
    [ModuleOutput]       DllModuleHost Start: 1 : DataTableCsvHandler::HandleArgumentString
    [ModuleOutput]       DllModuleHost Stop: 1 : DataTableCsvHandler::HandleArgumentString. Duration: 00:00:00.4933494
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[1] name = dataset2 , type = Microsoft.Numerics.Data.Local.DataTable
    [ModuleOutput]       DllModuleHost Verbose: 1 : Set optional parameter dataset2 value to NULL
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[2] name = bundlePath , type = System.String
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[3] name = rStreamReader , type = System.IO.StreamReader
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[4] name = seed , type = System.Nullable`1[System.Int32]
    [ModuleOutput]       DllModuleHost Verbose: 1 : Set optional parameter seed value to NULL
    [ModuleOutput]     DllModuleHost Stop: 1 : ParameterArgumentBinder::InitializeParameterValues. Duration: 00:00:00.5096483
    [ModuleOutput]     DllModuleHost Verbose: 1 : Begin invoking method Run ... 
    [ModuleOutput] Microsoft Drawbridge Console Host [Version 1.0.2108.0]
    [ModuleOutput] [1] 56000
    [ModuleOutput] 
    [ModuleOutput] The following files have been unzipped for sourcing in path=["src"]:
    [ModuleOutput] 
    [ModuleOutput]          Name Length                Date
    [ModuleOutput] 
    [ModuleOutput] 1    RMA_ml.R   6425 2014-11-10 10:40:00
    [ModuleOutput] 
    [ModuleOutput] 2 sfsmisc.zip 388736 2014-11-06 14:28:00
    [ModuleOutput] 
    [ModuleOutput] Loading objects:
    [ModuleOutput] 
    [ModuleOutput]   port1
    [ModuleOutput] 
    [ModuleOutput] [1] "Loading variable port1..."
    [ModuleOutput] 
    [ModuleOutput] package 'sfsmisc' successfully unpacked and MD5 sums checked
    [ModuleOutput] 
    [ModuleOutput] Loading required package: MASS
    [ModuleOutput] 
    [ModuleOutput] Error in density.default(as.numeric(dat_pca_c$lifeTime)) : 
    [ModuleOutput] 
    [ModuleOutput]   need at least 2 points to select a bandwidth automatically
    [ModuleOutput] 
    [ModuleOutput] In addition: Warning messages:
    [ModuleOutput] 
    [ModuleOutput] 1: In strptime(x, format, tz = tz) :
    [ModuleOutput] 
    [ModuleOutput]   unable to identify current timezone 'C':
    [ModuleOutput] 
    [ModuleOutput] please set environment variable 'TZ'
    [ModuleOutput] 
    [ModuleOutput] 2: In strptime(x, format, tz = tz) : unknown timezone 'localtime'
    [ModuleOutput] 
    [ModuleOutput] 3: package 'sfsmisc' was built under R version 3.1.2 
    [ModuleOutput] 
    [ModuleOutput] 4: NAs introduced by coercion 
    [ModuleOutput] 
    [ModuleOutput] 5: In max(numeric(0), na.rm = FALSE) :
    [ModuleOutput] 
    [ModuleOutput]   no non-missing arguments to max; returning -Inf
    [ModuleOutput] 
    [ModuleOutput]   DllModuleHost Stop: 1 : DllModuleMethod::Execute. Duration: 00:00:07.6458952
    [ModuleOutput]   DllModuleHost Error: 1 : Program::Main encountered fatal exception: Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException: Error 0063: The following error occurred during evaluation of R script:
    [ModuleOutput] ---------- Start of error message from R ----------
    [ModuleOutput] R script execution failed. Please click on "View Output Log" in the properties pane for full details.
    [ModuleOutput] ----------- End of error message from R -----------
    Module finished after a runtime of 00:00:07.7202613 with exit code -2
    Module failed due to negative exit code of -2
    
    Record Ends at UTC 11/10/2014 02:42:29.

    Thank you very much!

    Monday, November 10, 2014 6:32 AM
  • Hi!

    Could you please Visualize the input dataset to your Execute R Script module? Are both columns reported as type DateTime?

    If not, there could be some funky values in the second column causing the type inference to fail and default back to String.

    If they are, then both columns are passed into R as POSIXct type, or rather number of seconds from POSIX origin (1970-01-01T00:00 UTC), and any code capable of handling this should work

    Regards,

    AK

    Monday, November 10, 2014 9:55 PM
  • Thank you very much!

    After your recommendation, I went back to check my data.

    I found that some of my columns have some missing values, I think that's the reason why Azure will regarded it as string.

    Thanks a lot!! 

    • Proposed as answer by neerajkh_MSFT Tuesday, February 3, 2015 7:39 AM
    • Marked as answer by neerajkh_MSFT Tuesday, February 3, 2015 7:39 AM
    Tuesday, November 11, 2014 1:48 AM
  • Hi AK, 

    I have the same problem as the one described, but in other situation. I created a question in the forum: https://social.msdn.microsoft.com/Forums/expression/en-US/57c34b32-1232-42b7-9cd6-7e8b7e96acc8/timezone-error-when-saving-data-frame?forum=MachineLearning

    The real problem is I'm having this issue, after the data set is submited, so I dont have a way to workaround in the R code, and the microsoft azure output is not clear at all (it throws an error time, in a code where there is not time at all)

    Any help will be welcome :)

    Regards

    P.

     

    Thursday, April 21, 2016 11:05 PM