Shiny with R Studio Connect Error (subscript out of bounds)

Hi there

Im very knew to Shiny Apps. My firm got R server, R studio connect.
I've created my own app and it works fine when im just running it in my RStudio Server Pro.
But after I deployed it to RStudio Connect, it doesnt work when I press the lets say "run" button.. ((
It should connect to AWS and download the data you need, but it never start doing it.

So the log looks like this:

2022/02/04 13:18:37.657681655 Warning: Error in [[: subscript out of bounds
2022/02/04 13:18:37.667871407   158: gsub
2022/02/04 13:18:37.667882082   157: trim
2022/02/04 13:18:37.667933855   156: variables_requested
2022/02/04 13:18:37.667936738   155: infuse
2022/02/04 13:18:37.667962384   154: main_function
2022/02/04 13:18:37.667965853   153: eventReactiveValueFunc [/opt/rstudio-connect/mnt/app/server.R#30]
2022/02/04 13:18:37.667994281   109: dataInput
2022/02/04 13:18:37.667995530   108: renderTable
2022/02/04 13:18:37.668008132   107: func
2022/02/04 13:18:37.668020661    94: renderFunc
2022/02/04 13:18:37.668046261    93: output$result_table
2022/02/04 13:18:37.668048645    13: runApp
2022/02/04 13:18:37.668079530    12: fn
2022/02/04 13:18:37.668083846     7: connect$retry
2022/02/04 13:18:37.668121831     6: eval
2022/02/04 13:18:37.668123234     5: eval

If im not misstaken, it doesnt work because of error "out of bounds".

I put DESCRIPTION file with row "DisplayMode: Showcase" into my app director y, deployed it again and now my app's interface works in "Showcase" mode, but it didn't help me...

Can someone help me with this error?


This line might be a hint:
2022/02/04 13:18:37.667965853 153: eventReactiveValueFunc [/opt/rstudio-connect/mnt/app/server.R#30]

If it's possible, could you share what (object, variable...) is being used in that eventReactive?

Also, maybe there's an issue with credentials (since you say you are connecting to AWS). If so, you could try setting your credentials as environment variables in your RSConnect instance (for how to do it, see Solutions - Securing Deployed Content)


This post was published by an Appsilon team member. Our company can help you get the most out of RShiny and Posit/RStudio products.

Check our open positions here.

Appsilon: Building impactful RShiny Dashboards and providing R coding services.

Thanks for your reply. Post has been moderated for hours, so I figured out the solution by myself - problem was in my R code, with one bugged function. So I just turned it off for testing and ... it almost worked.

Now I faced a new problem - something is wrong with my permissions... My admin cannot help me for some reason, he says everything with permissions is fine. But i still see this error:

02/07 10:54:37.729 (GMT)
Warning in dir.create(tmp_dir) :
02/07 10:54:37.729 (GMT)
cannot create dir '/storage/rstudio-connect/athena/tmp', reason 'Permission denied'

Script has been used for more than a year, its purpose is to connect to AWS, and it created some tmp dirs and so on.. It works fine on my RPro, but it doesnt in r connect for some reason...

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.