Shiny runExample Error - Fail to create server

亡梦爱人 提交于 2019-11-30 13:08:47

This error could be because of blocked port.

I was running shiny server on port 3259. I killed the server for some reason and when i was trying to start it again i saw this error.

Error in startServer("0.0.0.0", port, httpuvCallbacks) : Failed to create server Calls: runApp -> startAppDir -> startApp -> startServer

To resolve you can first find the process which is blocking your port First use netstat to view the process blocing your port

netstat -anp|grep :3259[[:blank:]]

and then kill that process

Btibert3

@Hadley's last comment to re-install shiny and httpuv did the trick.

 devtools::install_github(c("shiny", "httpuv"), "rstudio") 

Actually with re-install you just stopped httpuv server in a difficult way. what you need to do is only stopServer the current running Server. What happens here is httpuv server is started but it did not stopped for some reason. now that you try to re-run your shiny app you cannot start it again, because it is already started and then you get the mentioned error.

to start your program in this case you can just run service in a loop, you don't need to start server again:

while (TRUE) {
  .Call("httpuv_run", PACKAGE = "httpuv", 250)
  Sys.sleep(0.001)
}

Though you also can stop previous server and start it again using:

stopServer(server)

however in this case you need to know where server variable is stored.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!