Old script, new server, unexpected error

I have an R script that retrieves data from a MySQL database, processes it, creates several charts and graphs, prints these graphs in files and returns the file names as strings. It worked fine on our old server (Solaris 10 (32 bit), running under R2.10.1), but now these are errors on our new server (Centos (64 bit) with R 2.12.1).

I will not publish the whole script as it is quite long and most of them work fine. He still accesses the database, processes the data, creates charts and graphs, and prints them to a file. It just does not return file names. This is mistake:

Error in save(exp, meta, MDist.median, redgrad.pal, colgrad.pal, phase_starts, : object รขx.gcรข not found Function brew returned an object of 'try-error'. 

Below are the bits of the script:

 <% Sys.umask(mode="0022") fn=tempfile('z_') fn.prof<-paste(fn,'prof',sep='.') fn.data<-paste(fn,'txt',sep='.') fn.r<-paste(fn,'rda',sep='.') fn.graph=paste(fn,'pdf',sep='.') library(Cairo) library(rjson) library(DBI) library(RMySQL) library(reshape) library(plyr) library('RColorBrewer') library(ggplot2) library(lattice) library(latticeExtra) library(hexbin) exp_id<-ifelse(is.null(POST$exp_id),0,as.numeric(POST$exp_id)) group_id<-ifelse(is.null(POST$groupset_id),0,as.numeric(POST$groupset_id)) saveR<-ifelse(is.null(POST$saveR),FALSE,as.logical(POST$saveR)) control<-ifelse(is.null(POST$control),'rowH',as.character(POST$control)) #open connection to db #process data #format #output pdf(fn.graph,title=meta$exp_name) dummy <- capture.output(print(plist)) #expensive: 3.56s print(dists.med.areaplot) #expensive: 5.67s print(dists.med.lplot) dev.off() ####HERE IS PROBLEM#### save(exp, meta, MDist.median, redgrad.pal, colgrad.pal, phase_starts, voi, plist, grect, nogrid, dists.med.areaplot, dists.med.lplot,x.gc, file=fn.r ) #return filenames to calling script cat(toJSON(list('filename'=fn.data, 'graph_pdf'=fn.graph,'rfile'=fn.r))) %> 

Thoughts?

ETA:

It comes down to LOCALE settings on the new server, different from the old server. The error message should be read: object "x.gc" not found . I found an abusive object and strictly told him. The problem is resolved (it really helps to have clear error messages!)

+4
source share
1 answer

The original poster answered the question. This question may be marked as an answer.

0
source

Source: https://habr.com/ru/post/1343818/


All Articles