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

404 error in check_version() after installing readr #32

Closed
judith-bourque opened this issue Jan 27, 2023 · 6 comments · Fixed by #33
Closed

404 error in check_version() after installing readr #32

judith-bourque opened this issue Jan 27, 2023 · 6 comments · Fixed by #33
Assignees
Labels
bug 🐛 Something isn't working

Comments

@judith-bourque
Copy link
Member

Also, I get a 404 after installing readr, but I'm new here, so problem could be a mistake on my part. Please ask if you need anything!

image

Originally posted by @huguesmp in #31 (comment)

@judith-bourque judith-bourque added the bug 🐛 Something isn't working label Jan 27, 2023
@judith-bourque
Copy link
Member Author

I've created a separate issue as it can be resolved separately from #31 😊

@judith-bourque
Copy link
Member Author

When I run hublot::check_version(), I get the same error message.

@judith-bourque
Copy link
Member Author

Proposed solution

Run each line in check_version() to see where the error comes from.

hublotr/R/util.R

Lines 381 to 405 in a21e7df

#' @export
check_version <- function(warn_only = F) {
current_version <- packageVersion("hublot")
online_version <- NULL
tryCatch(
{
online_version <- stringr::str_split(readr::read_lines("https://raw.githubusercontent.com/clessn/hublot/master/DESCRIPTION")[[4]], ": ")[[1]][[2]]
},
error = function(e) {
warning("could not check for updates")
}
)
online_version <- stringr::str_split(readr::read_lines("https://raw.githubusercontent.com/clessn/hublot/master/DESCRIPTION")[[4]], ": ")[[1]][[2]]
if (current_version != online_version) {
if (warn_only) {
warning(paste0("hublot version ", current_version, " is outdated (v", online_version, " available)!"))
} else {
stop(paste0("hublot version ", current_version, " is outdated (v", online_version, " available)!"))
}
} else {
print(paste0("hublot version ", current_version, " is up to date."))
}
}

@judith-bourque
Copy link
Member Author

judith-bourque commented Jan 27, 2023

In check_version, the first warning appears from this code:

hublotr/R/util.R

Lines 385 to 392 in a21e7df

tryCatch(
{
online_version <- stringr::str_split(readr::read_lines("https://raw.githubusercontent.com/clessn/hublot/master/DESCRIPTION")[[4]], ": ")[[1]][[2]]
},
error = function(e) {
warning("could not check for updates")
}
)

Warning message:

Warning message:
In value[[3L]](cond) : could not check for updates

If I change the repo name from hublot to hublotr in the following line, I don't get an error message:

online_version <- stringr::str_split(readr::read_lines("https://raw.githubusercontent.com/clessn/hublot/master/DESCRIPTION")[[4]], ": ")[[1]][[2]]

@judith-bourque
Copy link
Member Author

The second error message comes from

online_version <- stringr::str_split(readr::read_lines("https://raw.githubusercontent.com/clessn/hublot/master/DESCRIPTION")[[4]], ": ")[[1]][[2]]

Error message:

Error in open.connection(5L, "rb") : HTTP error 404.

When I switch the repo name from hublot to hublotr, there is no error message.

@judith-bourque
Copy link
Member Author

Proposed solution

Correct the repo name from hublot to hublotr in line 394 and 387.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant