ahmadassaf / roomba

A Node.js tool to examine the correctness of Open Data Metadata and build custom dataset profiles
http://roomba.ahmadassaf.com
12 stars 3 forks source link

Script stops after I enter a URL of the Data Portal #12

Closed andrelanger closed 8 years ago

andrelanger commented 8 years ago

Hi Ahmad,

your OpenData-Checker really looks great and I just wanted to test it on my own. So I cloned the git repository, installed all npm dependencies and ran the DC.js in my Windows 10 environment with node version v4.4.5.

The script starts and prompts me for the URL of the Data Portal where I enter http://publicdata.eu. However the script simply exits afterwards. Neither is an error message displayed nor does it output something like CKAN detected.

Can you give me some brief advice on how to fix this issue? It seems like all dependencies were downloaded and installed correctly without an error. Is there some kind of log or any other way to find out why the script execution simply quits?

Thanks in advance

André

filelist.txt

ahmadassaf commented 8 years ago

Hello Andre,

I have just pushed a quick fix to this issue. I wrongly was issuing a POST request to the url to check if it is a valid one instead of a GET. You could have traced that in the util/@checkValidAddress function, which in its turn will call the @checkAddress function. There we issued headers request with a POST so we used to get a 405 method not allowed.

I hope this resolved the issue from your end as well.

Best Ahmad

andrelanger commented 8 years ago

Hi Ahmad,

thanks for your immediate response.

I tested your fix quickly but there seems to be another issue in my environment when executing your script.

In util.prototype.getInput, the actual input and validation works fine and it also finishs the if(value) statement with return true; but afterwards it does not invoke the callback function and passes the name parameter to it. That means it does not step into , function(answer) { callback(answer[name]); }

My component version is

"name": "inquirer", "version": "1.0.3"

I will try to figure out what might be the issue on my computer setup and tell you as soon as possible.

Best regards

André

ahmadassaf commented 8 years ago

Hello Andre,

I have no issues at all now, maybe its platform related although i doubt that.

Let me know if i can be of any help and keep me updated on how things go.

Cheers Ahmad

andrelanger commented 8 years ago

Hi Ahmad,

I was able to resolve this issue. It was really related to the inquirer version. Since v1.0.x, the inquirer component uses the new promises/futures approach. If I downgrade the package to v0.8.0, everything works as expected. Let's maybe adapt the package file so that the npm does not pull the latest inquirer version.

Another note ... the example http://publicdata.eu/ does not seem to offer public API access any longer. We tested it instead with https://www.govdata.de/ckan/api/3/action/package_list which works, but the CKAN endpoint seems to not return a status code 200. We will test the opendata checker with other ckan endpoints within the next days.

Best regards

André

rtroncy commented 8 years ago

Thanks for the feedback, this is very useful. @ahmadassaf Can you at least specify in the README that there are issues with the newest version of the inquirer package? Can you also update the README with an example pointing to a CKAN portal where the tool works smoothly?