Shiny app fails after deployment: could not find function "validate_session_object"

I've just deployed an app to shinyapps.io. The deployment itself was successful, but when I visit my app in the browser, I get the greyed-out screen with the "disconnected from server" message after just a second or two of the app loading. The app runs fine on my local computer, and I've never had trouble deploying it in the past. I've made a few changes since the last deploy, but I can't immediately see how those changes could have caused this...

I looked at the logs on shinyapps.io, and they show an error that's baffling to me:

2021-04-05T20:50:24.458010+00:00 shinyapps[3372753]: Listening on http://127.0.0.1:35783
2021-04-05T20:50:34.403236+00:00 shinyapps[3372753]: Warning: Error in validate_session_object: could not find function "validate_session_object"
2021-04-05T20:50:34.407751+00:00 shinyapps[3372753]:   85: updateTabItems
2021-04-05T20:50:34.407752+00:00 shinyapps[3372753]:   13: runApp
2021-04-05T20:50:34.407753+00:00 shinyapps[3372753]:   12: fn
2021-04-05T20:50:34.407753+00:00 shinyapps[3372753]:    7: connect$retry
2021-04-05T20:50:34.407752+00:00 shinyapps[3372753]:   84: observeEventHandler [/srv/connect/apps/ygdpDashboard/app.R#496]
2021-04-05T20:50:34.407754+00:00 shinyapps[3372753]:    6: eval
2021-04-05T20:50:34.407782+00:00 shinyapps[3372753]:    5: eval
2021-04-05T20:50:34.592508+00:00 shinyapps[3372753]: [1] "Before updating colorCol(): sentence1"
2021-04-05T20:50:34.593129+00:00 shinyapps[3372753]: [1] "After updating colorCol(): sentence1"
2021-04-05T20:50:34.598908+00:00 shinyapps[3372753]: [1] "cci: sentence1.pred"
2021-04-05T20:50:34.756931+00:00 shinyapps[3372753]: [1] "Before updating input$colorCriteriaInterpolation: Sentence 1 ratings"
2021-04-05T20:50:34.757060+00:00 shinyapps[3372753]: [1] "nSentencesI: 1"
2021-04-05T20:50:34.757584+00:00 shinyapps[3372753]: [1] "After updating input$colorCriteriaInterpolation: Sentence 1 ratings"
2021-04-05T20:50:34.758908+00:00 shinyapps[3372753]: [1] "Before updating colorColI(): sentence1.pred"
2021-04-05T20:50:34.759397+00:00 shinyapps[3372753]: [1] "After updating colorColI(): sentence1.pred"

The last 8 lines are normal--those are some print() statements included in my app code, and they're all fine. But the Warning: Error in validate_session_object: could not find function "validate_session_object" is unexpected, and I have no idea how to start debugging it.

I certainly haven't tried to use the validate_session_object function in my code. I googled, and it looks like that's an internal function from the Shiny package, but I don't understand what it does or what might be going wrong.

Can anyone help me diagnose this? If there are other logs or system information I can provide, I'd be happy to do so.

Thank you!

At the suggestion of someone on Twitter, I updated shiny to the latest version, 1.6.0, and that seems to have solved the problem.

I'm a little confused, though. I had deliberately not updated any packages, because my dashboard is built on an older version of, among other things, shinydashboardplus. I haven't had time yet to update it to be compatible with the newer version, so I didn't want to change any of the other package versions, Shiny included, just in case that would mess something up. I'm using renv for that reason.

But it seems that renv fails when it comes to shiny itself? Why would renv not successfully preserve an older version of Shiny, which successfully ran the app on my own computer?

1 Like