Problems deploying app on Shiny

1,660 views
Skip to first unread message

Jon Arne Heskje

unread,
Mar 8, 2016, 10:49:16 AM3/8/16
to ShinyApps Users
Hi!
I am trying do deploy my app on shiny.io but get the following error:

> deployApp()
Preparing to deploy application...DONE
Uploading bundle for application: 86842...
Detecting system locale ... DONE
Deploying bundle: 390512 for application: 86842 ...
Waiting for task: 164242998
  building: Processing bundle: 390512
  building: Parsing manifest
  building: Fetching packages
  building: Building package: XML
################################ Begin Task Log ################################ 
[2016-03-08T15:46:21.038812177+0000] Installing R package: viridisLite (0.1.2)
Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
Calls: source -> file
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
  cannot open file 'packrat/init.R': No such file or directory
Execution halted
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 164243007 failed: Error building image: Error building XML (3.98-1.4). Build exited with non-zero status: 1
In addition: Warning message:
Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw'
 (Using default: en_US) 



Do anyone have a suggestion on what to do?

jonarne

Andy Kipp

unread,
Mar 8, 2016, 10:54:27 AM3/8/16
to Jon Arne Heskje, ShinyApps Users
Jon

You should be sure you do not have packrat autoloader enabled in your .Rprofile for your project.

-Andy

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/5f05b1e4-63e1-4960-ad54-f5b0ab45c05c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Arne Heskje

unread,
Mar 8, 2016, 12:16:30 PM3/8/16
to ShinyApps Users, jon...@gmail.com
Thanx, that worked! Really appreciate the quick response!

Now I have trouble with loading .RData file.

I have placed Data.RData in Data\\Data.RData and use load("Data\\Data.RData", envir=.GlobalEnv). It works when running locally, but crashes on the server.

Any suggestions?

jonarne

Jon Arne Heskje

unread,
Mar 8, 2016, 12:20:09 PM3/8/16
to ShinyApps Users, jon...@gmail.com
And the code is placed in server.R. I have tried both outside and inside shinyServer function.

Andy Kipp

unread,
Mar 8, 2016, 12:30:03 PM3/8/16
to Jon Arne Heskje, ShinyApps Users
You should use single forward slashes instead of double backslashes.

Jon Arne Heskje

unread,
Mar 8, 2016, 12:39:09 PM3/8/16
to ShinyApps Users, jon...@gmail.com
Have changed that, but still doesn't work.

I get following in chrome (the adress is https://gabler.shinyapps.io/Knekkpunktanalyse/:

An error has occurred

The application failed to start.

Warning in readChar(con, 5L, useBytes = TRUE) : cannot open compressed file '.\Data\Bedrift.RData', probable reason 'No such file or directory' Error in value[[3L]](cond) : cannot open the connection Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted



In the console I get:

Tareef Kawaf

unread,
Mar 8, 2016, 12:46:28 PM3/8/16
to Jon Arne Heskje, ShinyApps Users
Hi Jon,
You will want to switch those from .\Data\Bedrift.RData to ./Data/Bedrift.RData

-Tareef

Jon Arne Heskje

unread,
Mar 8, 2016, 12:47:48 PM3/8/16
to ShinyApps Users, jon...@gmail.com
I know, and I have done that. I still get the error-message which I have posted above.
Message has been deleted

Jon Arne Heskje

unread,
Mar 8, 2016, 1:24:32 PM3/8/16
to ShinyApps Users, jon...@gmail.com
Hi Andy,

Could you help me with the load() function??


I have the following code in server.R:

load("Data/Bedrift.RData")

This works when running locally on my computer, but not when published on the shiny server. 

Any suggestions??




tirsdag 8. mars 2016 16.54.27 UTC+1 skrev Andy Kipp følgende:

Andy Kipp

unread,
Mar 8, 2016, 1:27:17 PM3/8/16
to Jon Arne Heskje, ShinyApps Users
You should double check that you're using forward slashes (the URL you posted above still shows back slashes in the error message).

You should also check that the case of your file names and directories match EXACTLY. Shinyapps.io runs on linux and file names are case sensitive. 

-Andy

Jon Arne Heskje

unread,
Mar 8, 2016, 1:36:31 PM3/8/16
to ShinyApps Users, jon...@gmail.com
That's what I think is funny. I am writing:

load('Data/Bedrift.RData')

which has forward slashes, but the error-message is with back slashes. Why??

Andy Kipp

unread,
Mar 8, 2016, 1:51:56 PM3/8/16
to Jon Arne Heskje, ShinyApps Users
That does sound strange. Did you re-deploy your application after making the changes? 

By chance did you have the load statement duplicated in a different file?

Jon Arne Heskje

unread,
Mar 8, 2016, 2:06:29 PM3/8/16
to ShinyApps Users, jon...@gmail.com
I'm getting a very strange behaviour now.

If you  check this url https://gabler.shinyapps.io/Knekkpunktanalyse/  you'll see that the page is loading. But, it don't get any of the graphs...

I get the following warning message in my console after deployApp()

Warning message:
Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw'
 (Using default: en_US) 


???? I'm really confused!

Jon Arne Heskje

unread,
Mar 8, 2016, 2:12:54 PM3/8/16
to ShinyApps Users, jon...@gmail.com
Is this the same problem as in previous question here on Groups? https://groups.google.com/forum/#!topic/shinyapps-users/Fuh74H78G4s

When running rsconnect:::systemInfo() I get:

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  incomplete final line found by readTableHeader on 'raw'

This seems to me to be similar as the guy feidherbard in the url above.

My sessionInfo() is:

R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=Norwegian (Bokmål)_Norway.1252  LC_CTYPE=Norwegian (Bokmål)_Norway.1252   
[3] LC_MONETARY=Norwegian (Bokmål)_Norway.1252 LC_NUMERIC=C                              
[5] LC_TIME=Norwegian (Bokmål)_Norway.1252    

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

other attached packages:
[1] rsconnect_0.4.1.11

loaded via a namespace (and not attached):
[1] tools_3.2.1     RCurl_1.95-4.8  RJSONIO_1.3-0   digest_0.6.9    packrat_0.4.6-1 bitops_1.0-6   



Really appreciate the help!!

Andy Kipp

unread,
Mar 8, 2016, 2:39:28 PM3/8/16
to Jon Arne Heskje, ShinyApps Users
I don't think the warning is the issue at hand here perse. When I view the javascript console for your application, I see a bunch of syntax errors which lead me to believe there might be an encoding problem with your data. Is your data UTF-8 encoded?

Jon Arne Heskje

unread,
Mar 8, 2016, 2:41:08 PM3/8/16
to ShinyApps Users, jon...@gmail.com
Yes, I need it to be UTF-8 so I can write norwegian letters...

jonarne

Jon Arne Heskje

unread,
Mar 8, 2016, 2:48:05 PM3/8/16
to ShinyApps Users, jon...@gmail.com
And, just so you know, I have just written the needed data "by hand" into the script and deployed it. So, it will change the script that is used.

But, my guess is that the UTF-8 will still stop this???

-jonarne

Jon Arne Heskje

unread,
Mar 8, 2016, 2:57:43 PM3/8/16
to ShinyApps Users, jon...@gmail.com
I have just changes the encoding to ISO-8859-1 (System default). Still get the same error. 

Have also dropped using load() and have manually written in the data needed.

-jonarne

Jon Arne Heskje

unread,
Mar 9, 2016, 1:28:55 AM3/9/16
to ShinyApps Users, jon...@gmail.com
I have discovered the error.

I am using scandinavian letters (æøå) and have set the encoding to UTF-8 (by 'Save with encoding'). 

This still mess up the highchart widget (using java). So, when I deleted all scandinavian letters inside highchart-codes it works!

But I still get the warning message:
Warning message:
Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw'
 (Using default: en_US) 

jonarne

Andy Kipp

unread,
Mar 9, 2016, 10:55:29 AM3/9/16
to Jon Arne Heskje, ShinyApps Users
Jon,

I wouldn't worry about the warning, our locale detection code isn't perfect right now (especially on Windows). If you need override the locale string from the default (en_US) you can use:

options(rsconnect.locale = 'your_locale')

-Andy

Michal Šimaľ

unread,
May 13, 2016, 10:19:59 AM5/13/16
to ShinyApps Users, jon...@gmail.com
Hi Andy,

I have same problem but I can't solve it. Could you sent me description how to solve this problem ?

Thanks

Dňa utorok, 8. marca 2016 16:54:27 UTC+1 Andy Kipp napísal(-a):

Tareef Kawaf

unread,
May 13, 2016, 11:02:51 AM5/13/16
to Michal Šimaľ, ShinyApps Users, jon...@gmail.com
Could you include the error you are getting and whether you have tried out Andy's suggestion?
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/de96e4b5-4056-4fb9-8d84-c295d432a7db%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages