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

Error with AWS signing: argument "cache" is missing, with no default #705

Open
jcheng5 opened this issue Mar 19, 2025 · 0 comments · May be fixed by #706
Open

Error with AWS signing: argument "cache" is missing, with no default #705

jcheng5 opened this issue Mar 19, 2025 · 0 comments · May be fixed by #706

Comments

@jcheng5
Copy link
Member

jcheng5 commented Mar 19, 2025

This happens when trying to use ellmer with Bedrock. Reproduced by @jvroberts, @pyltime, and myself, the latter two on Posit's internal workbench instance.

Appears to have been introduced by #676.

Repro

chat <- ellmer::chat_bedrock(
  model = "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
)
chat$chat("Hello")

Result

Error in `req_auth_sign()`:
! argument "cache" is missing, with no default
Traceback
1. └─chat$chat("Hello")
  2.   └─coro::collect(...)
  3.     └─coro:::reduce_steps(x, steps, along_builder(list()))
  4.       └─coro:::reduce(x, reducer, .init = identity)
  5.         └─coro:::reduce_impl(.x, .f, ..., .init = .init)
  6.           └─coro:::iter_reduce_impl(.x, .f, ..., .left = .left)
  7.             ├─coro::is_exhausted(new <- .x())
  8.             └─coro (local) .x()
  9.               └─base::evalq(...)
 10.                 └─base::evalq(...)
 11.                   └─base::evalq(...)
 12.                     └─base::evalq(...)
 13.                       ├─coro::is_exhausted(elt <- iterator())
 14.                       └─coro (local) iterator()
 15.                         └─base::evalq(...)
 16.                           └─base::evalq(...)
 17.                             ├─base::evalq(...)
 18.                             │ └─base::evalq(...)
 19.                             │   └─coro (local) user(...)
 20.                             │     ├─.last_value <<- eval_bare(substitute(expr), user_env)
 21.                             │     │ └─rlang::env_poke(env, lhs, value, inherit = TRUE, create = FALSE)
 22.                             │     └─rlang::eval_bare(substitute(expr), user_env)
 23.                             └─ellmer:::chat_perform(...)
 24.                               └─ellmer:::chat_request(...)
 25.                                 ├─S7::S7_dispatch()
 26.                                 └─ellmer (local) `method(chat_request, ellmer::ProviderBedrock)`(...)
 27.                                   └─httr2::req_auth_aws_v4(...)
 28.                                     └─httr2:::req_auth_sign(...)
 29.                                       └─httr2:::req_policies(...) at [ark:namespace:httr2.R:3234:5](https://workbench.posit.it/s/ed7dc6ae9dc1b6851e53f/#)
 30.                                         └─httr2:::modify_list(.req$policies, ..., error_call = error_call)
 31.                                           └─rlang::list2(...)

I tried defaulting cache to NULL in req_auth_sign, which raised this error instead:

! unused argument (cache = NULL)
Traceback
Hide Traceback1. └─chat$chat("Hello")
  2.   └─coro::collect(...)
  3.     └─coro:::reduce_steps(x, steps, along_builder(list()))
  4.       └─coro:::reduce(x, reducer, .init = identity)
  5.         └─coro:::reduce_impl(.x, .f, ..., .init = .init)
  6.           └─coro:::iter_reduce_impl(.x, .f, ..., .left = .left)
  7.             ├─coro::is_exhausted(new <- .x())
  8.             └─coro (local) .x()
  9.               └─base::evalq(...)
 10.                 └─base::evalq(...)
 11.                   └─base::evalq(...)
 12.                     └─base::evalq(...)
 13.                       ├─coro::is_exhausted(elt <- iterator())
 14.                       └─coro (local) iterator()
 15.                         └─base::evalq(...)
 16.                           └─base::evalq(...)
 17.                             └─base::evalq(...)
 18.                               └─base::evalq(...)
 19.                                 ├─coro::is_exhausted(elt <- iterator())
 20.                                 └─coro (local) iterator()
 21.                                   └─base::evalq(...) at [ark:namespace:ellmer.R:633:13](https://workbench.posit.it/s/ed7dc6ae9dc1b6851e53f/#)
 22.                                     └─base::evalq(...)
 23.                                       ├─base::evalq(...) at [ark:namespace:ellmer.R:634:17](https://workbench.posit.it/s/ed7dc6ae9dc1b6851e53f/#)
 24.                                       │ └─base::evalq(...)
 25.                                       │   └─coro (local) user(...)
 26.                                       │     ├─.last_value <<- eval_bare(substitute(expr), user_env)
 27.                                       │     │ └─rlang::env_poke(env, lhs, value, inherit = TRUE, create = FALSE)
 28.                                       │     └─rlang::eval_bare(substitute(expr), user_env)
 29.                                       └─httr2::req_perform_connection(req)
 30.                                         └─httr2:::req_prepare(req)
 31.                                           └─httr2:::auth_sign(req)
 32.                                             └─rlang::exec(...)
@jcheng5 jcheng5 changed the title argument "cache" is missing, with no default Error: argument "cache" is missing, with no default Mar 19, 2025
@jcheng5 jcheng5 changed the title Error: argument "cache" is missing, with no default Error with AWS signing: argument "cache" is missing, with no default Mar 19, 2025
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

Successfully merging a pull request may close this issue.

1 participant