ropensci / MODIStsp

An "R" package for automatic download and preprocessing of MODIS Land Products Time Series
https://docs.ropensci.org/MODIStsp
GNU General Public License v3.0
155 stars 50 forks source link

[SOLVED] MODIStsp package is showing Username and password invalid even when the same credentials are working for NASA earth data search website #257

Closed AlkaRani29 closed 1 year ago

AlkaRani29 commented 1 year ago

The MODIStsp GUI is not downloading the files and showing Warning: Error in MODIStsp_download: Username and/or password are not valid. Please provide valid ones! But the credentials are true and are working for NASA earth data search website. Please look into the matter why MODIStsp package is not taking credentials now.

github-actions[bot] commented 1 year ago

@AlkaRani29 unfortunately the owner can no longer provide assistance for this package. If you need to ask for help or make a question about {MODIStsp} functionalities, refer to the package documentation first, and check if the topic was already addressed within closed issues. Then, address remaining doubts to public forums like StackOverflow, where other users could eventually provide useful ticks. If you are able to correct a bug, please address your changes in a pull request.

ranghetti commented 1 year ago

This was fixed with #256, you need to update the package from Github using the command remotes::install_github("ropensci/MODIStsp")

ranghetti commented 1 year ago

I leave this issue opened until CRAN version will be updated.

rsmiller74 commented 1 year ago

Issue remains after installing from github ropensci/MODIStsp.

EvertonTLima commented 1 year ago

O problema permanece após a instalação do github ropensci/MODIStsp.

Eu havia instalado pelo CRAN (v.2.0.8), deu usuário/senha inválida, então desinstalei, instalei novamente pelo #remotes::install_github("ropensci/MODIStsp"), aí funcionou bem (v.2.0.7)

rsmiller74 commented 1 year ago

I have updated R to version R version 4.2.1 (2022-06-23 ucrt) and installed remotes::install_github("ropensci/MODIStsp") (v.2.0.7) and get the same result User name and password not valid. I have double checked my login on the earth data website. I have included a reproducible example below.

--Load Libraries

remotes::install_github("mikejohnson51/AOI") remotes::install_github("ropensci/MODIStsp", force=TRUE) packageVersion("MODIStsp")

library(sf) library(AOI) library(MODIStsp)

--Make and set working dir

working.dir.path<-file.path(tempdir(), "temp") dir.create(working.dir.path) setwd(working.dir.path)

--Set Area of Interest

AOI = aoi_get(state = "IL")

st_write(AOI, dsn=file.path(working.dir.path), layer="tmp.poly.shp", driver='ESRI Shapefile', delete_layer=TRUE)

spatial.file.path <- paste0(file.path(working.dir.path,"tmp.poly.shp"))

--Get MODIS Landcover data

MODIStsp(gui = FALSE, out_folder = working.dir.path, out_folder_mod = working.dir.path, selprod = "LandCover_Type_Yearly_500m (MCD12Q1)", bandsel = "LC1", sensor = "Terra", user = "login" , password = "password", start_date = "2020.01.01", end_date = "2020.12.31", verbose = TRUE, spatmeth = "file", spafile = dirname(spatial.file.path), delete_hdf = TRUE, out_format = "GTiff", ts_format = "R RasterStack", reprocess = TRUE, parallel = 8 )

GDAL version in use: 3.4.3 [Thu Aug 25 15:34:36 2022] MODIStsp --> Starting processing [Thu Aug 25 15:34:36 2022] Accessing http server at: https://e4ftl01.cr.usgs.gov/MOTA/MCD12Q1.006/ [Thu Aug 25 15:34:37 2022] Retrieving list of available Terra Files for Year 2020 Error in MODIStsp_download(modislist, proc_opts$out_folder_mod, download_server, : Username and/or password are not valid. Please provide valid ones!

ranghetti commented 1 year ago

@rsmiller74 it is an issue related to your credentials, as you can see below.

#--Get MODIS Landcover data
MODIStsp(gui = FALSE,
         ...,
         user = "rsmiller" ,
         password = "Dall2020hunt",
         ...
)
GDAL version in use: 3.5.1
[Fri Aug 26 08:28:27 2022] MODIStsp --> Starting processing
[Fri Aug 26 08:28:27 2022] Accessing http server at:  https://e4ftl01.cr.usgs.gov/MOTA/MCD12Q1.006/
[Fri Aug 26 08:28:28 2022] Retrieving list of available ` Terra ` Files for Year 2020
 Errore in MODIStsp_download(modislist, proc_opts$out_folder_mod, download_server, : 
Username and/or password are not valid. Please provide
valid ones! 
#--Get MODIS Landcover data
MODIStsp(gui = FALSE,
         ...,
         user = "*** my username ***" ,
         password = "*** my password ***",
         ...
)
GDAL version in use: 3.5.1
[Fri Aug 26 08:29:14 2022] MODIStsp --> Starting processing
[Fri Aug 26 08:29:14 2022] Accessing http server at:  https://e4ftl01.cr.usgs.gov/MOTA/MCD12Q1.006/
[Fri Aug 26 08:29:14 2022] Retrieving list of available ` Terra ` Files for Year 2020
[Fri Aug 26 08:29:19 2022] Downloading Terra Files for date: 2020_01_01 : 1 of:  4
[Fri Aug 26 08:29:35 2022] Downloading Terra Files for date: 2020_01_01 : 2 of:  4
[Fri Aug 26 08:29:50 2022] Downloading Terra Files for date: 2020_01_01 : 3 of:  4
[Fri Aug 26 08:30:12 2022] Downloading Terra Files for date: 2020_01_01 : 4 of:  4
[Fri Aug 26 08:30:26 2022] [Fri Aug 26 08:30:26 2022] 4 files for date: 2020.01.01 were successfully downloaded!
...
rsmiller74 commented 1 year ago

Thanks for testing!

On Fri, Aug 26, 2022 at 12:33 AM Luigi Ranghetti @.***> wrote:

@rsmiller74 https://github.com/rsmiller74 it is an issue related to your credentials, as you can see below.

--Get MODIS Landcover data

MODIStsp(gui = FALSE, ..., user = "rsmiller" , password = "Dall2020hunt", ... )

GDAL version in use: 3.5.1 [Fri Aug 26 08:28:27 2022] MODIStsp --> Starting processing [Fri Aug 26 08:28:27 2022] Accessing http server at: https://e4ftl01.cr.usgs.gov/MOTA/MCD12Q1.006/ [Fri Aug 26 08:28:28 2022] Retrieving list of available Terra Files for Year 2020 Errore in MODIStsp_download(modislist, proc_opts$out_folder_mod, download_server, : Username and/or password are not valid. Please provide valid ones!

--Get MODIS Landcover data

MODIStsp(gui = FALSE, ..., user = " my username " , password = " my password ", ... )

GDAL version in use: 3.5.1 [Fri Aug 26 08:29:14 2022] MODIStsp --> Starting processing [Fri Aug 26 08:29:14 2022] Accessing http server at: https://e4ftl01.cr.usgs.gov/MOTA/MCD12Q1.006/ [Fri Aug 26 08:29:14 2022] Retrieving list of available Terra Files for Year 2020 [Fri Aug 26 08:29:19 2022] Downloading Terra Files for date: 2020_01_01 : 1 of: 4 [Fri Aug 26 08:29:35 2022] Downloading Terra Files for date: 2020_01_01 : 2 of: 4 [Fri Aug 26 08:29:50 2022] Downloading Terra Files for date: 2020_01_01 : 3 of: 4 [Fri Aug 26 08:30:12 2022] Downloading Terra Files for date: 2020_01_01 : 4 of: 4 [Fri Aug 26 08:30:26 2022] [Fri Aug 26 08:30:26 2022] 4 files for date: 2020.01.01 were successfully downloaded! ...

— Reply to this email directly, view it on GitHub https://github.com/ropensci/MODIStsp/issues/257#issuecomment-1228109893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB26UHDOGGOVR7JKGSUUET3V3BQJ5ANCNFSM57C6VG6Q . You are receiving this because you were mentioned.Message ID: @.***>

ranghetti commented 1 year ago

Version 2.0.9, which includes the fix for this issue, was released on CRAN; I'm closing this.

olatunjijohnson commented 4 months ago

I'm having the same issue. Tried installing the GitHub version but still have the error:


  Username and/or password are not valid. Please provide
             valid ones!`
jfmas commented 3 months ago

Same issue: I get the error GDAL version in use: 3.4.1 [Tue Apr 2 12:54:54 2024] MODIStsp --> Starting processing [Tue Apr 2 12:54:54 2024] Accessing http server at: https://e4ftl01.cr.usgs.gov/MOLA/MYD21A1D.061/ [Tue Apr 2 12:54:58 2024] Retrieving list of available Aqua Files for Year 2003 Error in MODIStsp_download(modislist, proc_opts$out_folder_mod, download_server, : Username and/or password are not valid. Please provide valid ones! However if I go directly to https://e4ftl01.cr.usgs.gov/MOLA/MYD21A1D.061/ with the same user/passwd I am able to download the data

jinxulisduniversity commented 3 months ago

I ran into the same problem, but after updating with remotes::install_github("ropensci/MODIStsp"), it still doesn't work, is there any solution?

calvus17 commented 2 months ago

The same authentication problem here. May I suggest revisiting this issue?

jfmas commented 2 months ago

Yes please!

JF Mas

El jue., 2 de mayo de 2024 10:12, calvus17 @.***> escribió:

The same authentication problem here. May I suggest revisiting this issue?

— Reply to this email directly, view it on GitHub https://github.com/ropensci/MODIStsp/issues/257#issuecomment-2089864880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFTP5PWNKVT5WHLOPJPE543ZAHYPNAVCNFSM57C6VG62U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBYHE4DMNBYHAYA . You are receiving this because you commented.Message ID: @.***>

ranghetti commented 2 months ago

@olatunjijohnson @jfmas @jinxulisduniversity @calvus17 This package is currently unmaintained. Anyone who wants to contribute is invited to fix it (probably the reason would be a recent change in the USGS API) and submit a PR (as done last year for https://github.com/ropensci/MODIStsp/pull/256). If the PR will not be accepted, tag @maelle (I have no more rights to accept them).

kirstentyler commented 2 months ago

I would also appreciate a fix for this!

maelle commented 2 months ago

Is there anyone willing to take over the package?

https://devguide.ropensci.org/maintenance_changing_maintainers.html https://ropensci.org/blog/2023/02/07/what-does-it-mean-to-maintain-a-package/

pkautio commented 2 months ago

The same authentication problem here. May I suggest revisiting this issue?

I'm looking into it. I cannot get authentication to work towards Nasa website even with a simple httr call without modistsp package. Something seems to be changed at Nasa site.

Also, the package used for this (httr) is no obsolete could be replaced with httr2 while fixing this.

pkautio commented 2 months ago

Update: New working authentication code is in testing. MODIStsp has been updated to use Bearer token authentication and httr2 package.

maelle commented 2 months ago

:rocket:

LouiseLeroux commented 2 months ago

Hi. Where can we find the updated version of MODIStsp? We are facing the same issue :) Many thanks

EvertonTLima commented 3 weeks ago

O problema ainda persiste.

LaughingKing1 commented 4 days ago

Was there a fix for this issue, I'm getting the same error?