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

Issue with download_hydat() during extraction #192

Open
SteveCoss opened this issue Feb 13, 2023 · 3 comments
Open

Issue with download_hydat() during extraction #192

SteveCoss opened this issue Feb 13, 2023 · 3 comments
Labels

Comments

@SteveCoss
Copy link

After a successful download, Hydat is no longer extracting correctly on linux server.

image

  • OS: Red Hat Enterprise Linux Server

Additional context
was functioning fine, then I was having issues so I updated versions of tidyhydat (running the github version now) and get this error on update. I've tried:
fp=hy_dir()
ffp=paste(fp,"/*",sep = "")
unlink(ffp, recursive = T, force = T)
print("hydat version older than today's date. Downloading hydat.")
download_hydat(dl_hydat_here = NULL, ask = FALSE)

Which I was using previously if hydat wouldn't download. I suspect this issue is related to recent server updates on my end, but I'm hoping there's a workaround that skips the temporary directory.

@boshek
Copy link
Collaborator

boshek commented Feb 15, 2023

Hi there. Thanks for reporting this. A couple things. I have a Linux server that I have access too and using the most recent version of tidyhydat, I was not able to reproduce this.

So a couple options. You could try downloading hydat to a different location via the dl_hydat_here argument. Then you could set that path in every function you call. So for example:

library(tidyhydat)
download_hydat(dl_hydat_here = "my/cool/path")

hy_daily_flows("08MF005", hydat_path = "my/cool/path")

Really we should have set that so that you can use an environment variable. If you ever felt like making a PR adding the ability to set the download location via environment variable would be really good.

The other option is to just manually download it from ECCC and then move it to the location of hy_dir()

@SteveCoss
Copy link
Author

Hey Sam,
I think what's happening is that my server permissions are forcing it to go to that temp folder no mater what path argument I pass. Moving the file is a great workaround until I can sort that out sit the admin folks. Thanks for your help.

@boshek
Copy link
Collaborator

boshek commented Feb 15, 2023

Weird. Anything info you can provide is much appreciated because I'd love to sort this out for users. If you step through the download_hydat() function, can you see exactly where that forcing is happening?

@boshek boshek added the bug label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants