Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startPipeServer broken since 1.5.3.1 #282

Open
PromyLOPh opened this issue Jul 30, 2020 · 1 comment
Open

startPipeServer broken since 1.5.3.1 #282

PromyLOPh opened this issue Jul 30, 2020 · 1 comment

Comments

@PromyLOPh
Copy link
Contributor

I’ve been debugging an issue I’m having with rmarkdown/shiny and came to the conclusion this must be a bug in httpuv. Originally I tried to run:

$ R -q --no-save -e 'rmarkdown::run(file = NULL, dir = ".", shiny_args=list(port=structure("test.sock", mask=0), quiet=FALSE, launch.browser=FALSE))'

But I can reproduce the issue with the example code from the README as well, replacing startServer with startPipeServer:

library(httpuv)

s <- startPipeServer(name="test.sock", mask=NULL,
  app = list(
    call = function(req) {
      body <- paste0("Time: ", Sys.time(), "<br>Path requested: ", req$PATH_INFO)
      list(
        status = 200L,
        headers = list('Content-Type' = 'text/html'),
        body = body
      )
    }
  )
)

This is the output with 1.5.3.1:

$ R -q -f server.R
> library(httpuv)
>
> s <- startPipeServer(name="test.sock", mask=NULL,
+   app = list(
+     call = function(req) {
+       body <- paste0("Time: ", Sys.time(), "<br>Path requested: ", req$PATH_INFO)
+       list(
+         status = 200L,
+         headers = list('Content-Type' = 'text/html'),
+         body = body
+       )
+     }
+   )
+ )
createPipeServer: invalid argument
Error in .subset2(public_bind_env, "initialize")(...) :
  Failed to create server
Calls: startPipeServer -> <Anonymous> -> <Anonymous>
In addition: Warning message:
In normalizePath(name) : path[1]="test.sock": No such file or directory
Execution halted

(notice the error “invalid argument”)
This works with 1.5.2, so I’m assuming this is a regression introduced by the upgrade from libuv 1.27 to 1.37.

@wch
Copy link
Collaborator

wch commented Jul 31, 2020

It looks like the error is coming from here:
https://github.com/libuv/libuv/blob/v1.x/src/unix/pipe.c#L98-L99

That was introduced by:
libuv/libuv#2559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants