Skip to content

Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed #191

Closed

Description

@shalutiwari

Getting this error when running below mytest.R . Error goes away when download lines are commented.

app <- ShinyDriver$new("../", shinyOptions = list(display.mode = "normal"))
app$snapshotInit("mytest")

app$snapshot()
app$snapshot()
app$snapshot()
app$setInputs(sanitize = "TRUE")
app$snapshot()
app$snapshotDownload("downloadData")
app$setInputs(safe = "TRUE")
app$snapshotDownload("downloadData")
recordTest('110-error-sanitization',shinyOptions = list(display.mode="normal"))
Loading required package: shiny

Listening on http://127.0.0.1:7073
Saved test code to /Users/shalutiwari/shiny-examples-branch/shiny-examples/110-error-sanitization/tests/mytest.R
Running mytest.R Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed

Activity

  1. hadley commented on Aug 12, 2020

    @hadley
    Member

    I don't see any error when running:

    path <- "../shiny-examples/110-error-sanitization"
    shinytest::recordTest(path)

    So maybe it's that test that's the problem? Ok, yes, this generates the error:

    path <- "../shiny-examples/110-error-sanitization"
    dir.create(file.path(path, "tests", "shinytest"), recursive = TRUE)
    writeLines(con = file.path(path, "tests", "shinytest", "mytest.R"),  '
    app <- ShinyDriver$new("../../")
    app$snapshotInit("mytest")
    app <- ShinyDriver$new("../../")
    app$snapshotInit("mytest")
    app$snapshotDownload("downloadData")
    ')
    shinytest::testApp(path)
  2. hadley commented on Aug 12, 2020

    @hadley
    Member

    And this is because self$findElement(paste0("#", id))$getAttribute("href") returns "". So we need to provide an informative error here, either checking that href exists or checking that httr::GET() succeeds (or both).

  3. added
    bug
    on Aug 12, 2020
  4. hadley commented on Aug 12, 2020

    @hadley
    Member

    Same underlying cause as #195

  5. hadley commented on Aug 14, 2020

    @hadley
    Member

    Simpler reprex:

    app <- ShinyDriver$new("../shiny-examples/110-error-sanitization")
    app$snapshotInit("mytest")
    app$snapshotDownload("downloadData")
  6. added a commit that references this issue on Aug 14, 2020
    dd14186
  7. added a commit that references this issue on Aug 19, 2020
    a3bbf0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ShinyDriver 🏎️bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions