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 in check_availability() Not Found (HTTP 404). Failed to process request. #79

Closed
Muesgen opened this issue Dec 30, 2020 · 4 comments

Comments

@Muesgen
Copy link

Muesgen commented Dec 30, 2020

Hey @16EAGLE ,

This issue is related to #76
I was able to solve the error

when i execute check_availabilty() i get the following error:

records <- check_availability(records)
Checking instant availability for Sentinel records...
Error in .get(paste0(cred[3], "/odata/v1/Products('", x, "')/", field),  : Not Found (HTTP 404). Failed to process request.

The Error occurs in the check_availability() function at line 19:24

  records[records$product_group` == "Sentinel" & 
            !records$is_gnss, ]$download_available <- .apply(records.sentinel, 
                                                             MARGIN = 1, function(x, names = colnames(records.sentinel)) {
                                                               as.logical(toupper(unlist(.get_odata(x$entity_id, 
                                                                                                    x$cred, field = "Online/$value"))))
                                                             })

Here the Error comes from the .get_odata() function:

.get_odata <- function(uuid, cred, field = ""){
lapply(uuid, function(x) content(.get(paste0(cred[3], "/odata/v1/Products('", x, "')/", field),  cred[1], cred[2])))
}

The problem here is that a wrong url is created. one "/" too many is created:
your current code creates:

https://scihub.copernicus.eu/dhus//odata/v1/Products('2b17b57d-fff4-4645-b539-91f305c27c69')/Online/$value

How the URL should look like:

https://scihub.copernicus.eu/dhus/odata/v1/Products('2b17b57d-fff4-4645-b539-91f305c27c69')/Online/$value

As you can see, there is one too many "/"s before "odata".

So when you remove the "/" in your .get_odata() function, for me as a windows user, the function .get_odata() and check_availability() works fine.

Here is the .get_odata() function with which it works:

.get_odata <- function(uuid, cred, field = ""){
  lapply(uuid, function(x) content(.get(paste0(cred[3], "odata/v1/Products('", x, "')/", field),  cred[1], cred[2])))
}

It would be cool if you could fix this quickly.
The package is quite good by the way :)

@manan-gup
Copy link

Hey, is this R package not supported anymore? There has been no commit to it in 4 and a half months. Asking to figure out if I should depend on this package for my work or figure out another solution.

@ramonmelser
Copy link

Has this issue been resolved in the code yet? I'm considering using the package for a project, but am getting the errors listed above. I just installed the package a few days ago, how can I go about fixing the issue?

@Muesgen
Copy link
Author

Muesgen commented May 21, 2021

My workaround is to fork the package. Manually change the above mentioned solution in the script and then install it.

16EAGLE added a commit that referenced this issue May 25, 2021
Updated internal_clients.R to reflect #79 issue
@16EAGLE
Copy link
Owner

16EAGLE commented May 25, 2021

Thank you for raising this issue and your patience. Should be fixed with #86. Please reopen in case you encounter the same issue again.

@16EAGLE 16EAGLE closed this as completed May 25, 2021
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

4 participants