Using Credentials with pkgdown


I am using pkgdown to build articles for documentation at work. In one of the examples that I am using, I am connecting to Hive database which needs credentials. I was able to use knitr with parameters to knit the document using credentials, and I was able to get the document to knit with secrets stored in a file on my local. See below:

title: "Title"
author: Alfredo Marquez
date: "`r Sys.Date()`"
    label: "Enter Var1:"
    value: ""
    input: text
    label: "Enter Var2:"
    value: ""
    input: password

The problem is not knitting the document, that works, meaning that the document connects to the Hive data base and pulls data and builds the document. It also pulls from a Postgres server with RPostgres for part of the analysis, but this does not seem to have any issues. Actually it worked fine until I started pulling from Hive.

The problem is when I run pkgdown::build_site() the connection function fails to make the connection. Neither with the knitr with params nor pulling the secrets from a file gets the connection to work with pkgdown.

Error, but not all pasted because has work stuff in it. I have loaded all required libraries too:

EVERE: Error opening session
org.apache.thrift.transport.TTransportException: HTTP Response code: 401
	at org.apache.thrift.transport.THttpClient.flushUsingHttpClient(
	at org.apache.thrift.transport.THttpClient.flush(
	at org.apache.thrift.TServiceClient.sendBase(
	at org.apache.thrift.TServiceClient.sendBase(
	at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(
	at org.apache.hive.jdbc.HiveConnection.openSession(
	at org.apache.hive.jdbc.HiveConnection.<init>(
	at org.apache.hive.jdbc.HiveDriver.connect(

Quitting from lines 69-74 (Onboarding.Rmd) 
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 
  java.sql.SQLException: Could not establish connection to 


Loading required package: rJava
Error : Failed to render RMarkdown
Error: callr subprocess failed: Failed to render RMarkdown
Type .Last.error.trace to see where the error occurred


> .Last.error.trace

 Stack trace:

 Process 21624:
 1. pkgdown::build_site()
 2. pkgdown:::build_site_external(pkg = pkg, examples = examples,  ...
 3. callr::r(function(..., crayon_enabled, crayon_colors, pkgdown_internet) { ...
 4. callr:::get_result(output = out, options)
 5. throw(newerr, parent = remerr[[2]])

 x callr subprocess failed: Failed to render RMarkdown 

 Process 9068:
 17. (function (..., crayon_enabled, crayon_colors, pkgdown_internet)  ...
 18. pkgdown::build_site(...)
 19. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = r ...
 20. pkgdown:::build_articles(pkg, lazy = lazy, override = override,  ...
 21. purrr::walk(pkg$vignettes$name, build_article, pkg = pkg, quiet = quiet,  ...
 22. purrr:::map(.x, .f, ...)
 23. pkgdown:::.f(.x[[i]], ...)
 24. pkgdown:::render_rmarkdown(pkg, input = input, output = output_file,  ...
 25. base:::tryCatch(callr::r_safe(function(...) rmarkdown::render(...),  ...
 26. base:::tryCatchList(expr, classes, parentenv, handlers)
 27. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
 28. value[[3L]](cond)
 29. rlang:::abort("Failed to render RMarkdown", parent = cnd)
 30. rlang:::signal_abort(cnd)
 31. base:::signalCondition(cnd)
 32. (function (e)  ...

 x Failed to render RMarkdown 


Thanks for any help or ideas.


This topic was automatically closed 21 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.