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

Calling drop on index causes crash #27

Open
sirws opened this issue May 26, 2015 · 13 comments
Open

Calling drop on index causes crash #27

sirws opened this issue May 26, 2015 · 13 comments
Labels

Comments

@sirws
Copy link

sirws commented May 26, 2015

When I call something like:
http://50.18.49.187/koop/socrata/wa/9ubz-5r4b/ + 'drop'...

I get:
Error: spawn rm ENOENT, Error: spawn rm ENOENT, Error: spawn rm ENOENT

This is Koop/Koop-Socrata on windows.

@sirws sirws changed the title Calling drop on index caused crash Calling drop on index causes crash May 26, 2015
@chelm
Copy link
Contributor

chelm commented May 26, 2015

@sirws would you mind adding you config file? I just want to see what set so I can match it.

@sirws
Copy link
Author

sirws commented May 26, 2015

@chelm Bear with me... Are you talking about the \koop-sample-app\config\default.json?

@sirws
Copy link
Author

sirws commented May 26, 2015

{
"server": {
"port": 1337
},
"data_dir": "/usr/local/koop/",
"db": {
"conn": "postgres://user:password@localhost/koopdev"
}
}

@chelm
Copy link
Contributor

chelm commented May 26, 2015

@sirws Interesting. Dnt see it locally. It might a windows issue. Whats going on is that "/drop" calls the local file system and tries to remove directories of exported data. It could be that on windows it throws an error where on mac/unix it just ignores it.

@chelm
Copy link
Contributor

chelm commented May 26, 2015

In fact looking at how koop removes dirs might be the issue...

https://github.com/Esri/koop/blob/master/lib/Files.js#L173-L180

That seems pretty "linuxy" to me. There may be some way to make that work in both Windows and Linux/Mac. you could try to commented some of that code out.

Also I'm curious if you have tried running the koop test suite on windows?

@sirws
Copy link
Author

sirws commented May 26, 2015

How does "data_dir": "/usr/local/koop/" translate to windows? Since this isn't a *nix os?

Do you think I need to change the data_dir to something more windozy?

@sirws
Copy link
Author

sirws commented May 26, 2015

Hahah! No, I haven't run the koop test suite. Is there some good doc on that?

@chelm
Copy link
Contributor

chelm commented May 26, 2015

@sirws oh yes! you are probably right on making the data_dir more windows freindly! I bet thaat might help.

To run the tests just:

cd node_modules/koop
npm install --dev 
npm test 

@sirws
Copy link
Author

sirws commented May 26, 2015

@chelm Well, looking at the code, it is calling rm which is not a windows command. Perhaps I will log a bug to handle that on windows properly.

@chelm
Copy link
Contributor

chelm commented May 26, 2015

right. Im guessing there is a recursive remove dir module that will work on both OS, we could add that as a dep to Koop so that this will work.

@chelm
Copy link
Contributor

chelm commented May 26, 2015

This might work, but looks like it has issues on windows too: https://github.com/isaacs/rimraf

@sirws
Copy link
Author

sirws commented May 26, 2015

Are there any local files getting created? I am not seeing any on windows. Not sure where they would be.

/koop/socrata/wa/9ubz-5r4b/drop undefined {} {}
debug: 0=D:/koop-sample-app/data/files/socrata:https://data.wa.gov:9ubz-5r4b
debug: 0=D:/koop-sample-app/data/tiles/socrata:https://data.wa.gov:9ubz-5r4b
debug: 0=D:/koop-sample-app/data/thumbs/socrata:https://data.wa.gov:9ubz-5r4b

There is nothing the d:\koop-sample-app\data directory.

@chelm
Copy link
Contributor

chelm commented May 28, 2015

@sirws Files will only get written when an export is created. And actually this raising a new issue about the dir structure. It'd be cleaner if koop contained the file dirs under the item id first. I'll make an issue for that.

@dmfenton dmfenton added the bug label Jun 10, 2015
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

3 participants