CKAN API Request doesn't work: `http://demo.ckan.org/api/3/action/package_list` - api

I've run into a strange problem that a simple API request doesn't work. I tried to call http://demo.ckan.org/api/3/action/package_list and http://127.0.0.1:5000/api/3/action/package_list, and both resulted in the error: "No such file or directory".
When I run http http://127.0.0.1:5000/api/3/action/package_list, I get "result": []
If I browse CKAN through it's user interface, I can see the datasets.
Before running this command, I activated the virtual environment and started up CKAN server.
Do anyone know what might be the problem??
p.s. this same command worked before, but it doesn't work anymore today.. and I've tried to restart the virtual machine.. since I'm pretty new to development, it could also be that I missed some pre-conditions. Any advice would be very much appreciated!
Thanks a lot in advance!
Qing

Related

how to properly see the errors of a flask application in production mode

I have made a flask application at my local computer in the debugging mode and it runs all fine. But when it comes to production, the website gives me 500 or internal server error, which I have no idea what the bug is. I am fairly new to flask production and this has been stopping me from moving forward for quite a few days.
My questions are:
1> in my local development environment, one could always print things out. But how can I see those prints in the production stage?
2> Do I see them through Apache2 log? Where is Apache2 log?
For production, I actually followed the tutorials from pythonprogramming.net. Youtube link is here:
https://www.youtube.com/watch?v=qZNL4Ku1UQg&list=PLQVvvaa0QuDc_owjTbIY4rbgXOFkUYOUB&index=2
To use a very simple example, if the code imports a package which wasn't installed, where can we see the errors?
Thanks in advance.
I've tried to use to use try ... except block for every flask function. Whenever there is an exception, it can be return to the front-end. But what about other errors?
I found out:
Use logging module
Read apache2 log from /var/log/apache2

WT 8-1: Getting HTTP GET on resource 'http://training4-american-api-maryumsiddique.us-e2.cloudhub.io:80/flights' failed: not found (404)

I'm doing mule 4 training and currently I'm on WT 8-1. I followed all the steps as they told and when I run the project it deployed successfully. But when I call "http://localhost:8081/american" from postman it gives me the following error.
Although the status is Started on Runtime Manager as below.
In API Manager the status is Active as well.
And I cannot figure out what's the issue. Can anyone please tell me what should I do?
Really appreciate the help 🙂
Likely your app deployed locally is not calling the right URL for the API deployed in CloudHub. Maybe the URL should be http://training4-...cloudhub.io/api/flights or something like it.

Dr.Racket for SICP

I am setting up DR.Racket for SICP. By following this guide
http://docs.racket-lang.org/sicp-manual /index.html?q=sicp#%28part._.Introduction_to_the__lang_sicp_language%29
But I am not able to download sicp package. Following is the error message I recieved after hitting install.
Resolving "sicp" via https://download.racket-lang.org/releases/6.11/catalog/
ssl-connect: connect failed (error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed)
Please explain what to do?
Apologies if I'm telling you things you already know: it appears that certificate validation failed while contacting the racket package server.
There are several things that could cause this, but I have a sneaking suspicion that you have some kind of proxy standing between you and the server that is rewriting your traffic. Is this possible?
One way to test this would be to try installing the package on a different computer, connected to a different network.
(FWIW, I just tested this installation myself, and didn't encounter this problem. So, at a minimum, it's not that the world is broken :).)

Heroku: http-error 410. Invalid response from API (I am not behind a proxy)

I am currently having some issues with heroku. I just installed it and tried to heroku create. It takes my credentials but so far i just get this
! HTTP Error: https://api.heroku.com/login 410 Gone
! Invalid response from API.
! HTTP 410
! {myMail myPw}
!
! Are you behind a proxy?
! https://devcenter.heroku.com/articles/using-the-cli#using-an-http-proxy
I have been looking around for others with that issue but they all were behind a proxy. I am not. I also checked my firewall settings and also tried to run the command line client with admin rights. But nothing has proven to be successful so far. I'll keep trying and post an answer as soon as i figure it out. Maybe someone of you has an idea. Would be appreciated. Thanks in advance and
Greetings Chris
EDIT
Maybe some info. I'm running
Windows 10 Pro (V10.0.15063)
and a basic network setup with a router and DHCP
I had the same problem today.
When I type
heroku
in my Command Prompt, it promotes me to enter my email and after that my password. Then I got the same error message as you.
After that instead "heroku" I typed
heroku login
I entered the same email and password and everything was fine.
Ok. I made it work. Unfortunately I'm not really understanding why this worked which is pretty unsatisfying but I'll tell you what I did. I stumbled on some posts that were saying heroku-cli is outdated if that happens. First I tried to update it with npm using
npm update -g heroku-cli
which basically made heroku stop working alltogether because now the cli reported it needed node >7.X (and I was still running on 6.X). The node update I then made also didn't help because now heroku-cli was unable find the command bash.
In the end I just reinstalled heroku. After that (with at first getting the same error as in the beginning) I first did
heroku update
and after that heroku login worked. Now why I don't really grasp and maybe someone of you guys knows. But the version I had before heroku update was exaclty the same as afterwards
heroku-cli/5.11.12-8ae9780 (windows-amd64) go1.7.5
I found out the heroku.cl was blocked by my antivirus and unblocked it. Now its working flawless.
Updating Heroku worked for me.
heroku update

Proxy settings in RStudio for third party API access

I'm using RStudio on a server that is behind my company's firewall. I referred to the link here and did the same changes in my RProfile script:
RProfile
http_proxy=http://proxy.dom.com:80
http_proxy_user=user:passwd
I'm trying to access an API (Omniture a.k.a. api.omniture.com) using the package RSiteCatalyst and even though I mentioned the proxy, I'm unable to bypass the firewall. Below is what I do:
library(RSiteCatalyst)
SCAuth('username','shared-secret') # Authentication
And the error that I get
Error in function (type, msg, asError = TRUE) :
Could not resolve host: api.omniture.com
Before going to IT I came here for the StackOverflow gods to help out. Would greatly appreciate it. Thanks.
I think that article has a typo. Can you put the http_proxy lines in your .Renviron rather than your .Rprofile, then restart RStudio? (If that does the job, we'll update the article!)