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

Error running examples/quickstart.py #26

Closed
jhoelzl opened this issue Apr 18, 2016 · 6 comments
Closed

Error running examples/quickstart.py #26

jhoelzl opened this issue Apr 18, 2016 · 6 comments

Comments

@jhoelzl
Copy link
Contributor

jhoelzl commented Apr 18, 2016

Hello,

i got errors when running the quickstart.py example file using Python 2.7.6 (Ubuntu 14.04) in an virtualenv.

pip install wit

leads to:

pip (8.1.1)
requests (2.9.1)
setuptools (20.9.0)
simplejson (3.8.2)
wheel (0.29.0)
wit (3.4.0)

Running python quickstart.py leads to:

/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Executing merge
/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Traceback (most recent call last):
  File "quickstart.py", line 41, in <module>
    client.run_actions(session_id, 'weather in London', {})
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 108, in run_actions
    message)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 103, in __run_actions
    user_message)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 67, in __run_actions
    rst = self.converse(session_id, message, context)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 61, in converse
    return req(self.access_token, 'POST', '/converse', params, json=context)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 23, in req
    ' (' + rsp.reason + ')')
wit.wit.WitError: Wit responded with status: 404 (Not Found)

Before i was using wit (2.0) with requests (1.2.0) which works fine. I think a newer version of requests causes the SSL warnings.

@jhoelzl
Copy link
Contributor Author

jhoelzl commented Apr 18, 2016

After installing

pip install pyopenssl ndg-httpsclient pyasn1 cryptography

i still get this errors:

Executing merge
Traceback (most recent call last):
  File "quickstart.py", line 41, in <module>
    client.run_actions(session_id, 'weather in London', {})
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 108, in run_actions
    message)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 103, in __run_actions
    user_message)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 67, in __run_actions
    rst = self.converse(session_id, message, context)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 61, in converse
    return req(self.access_token, 'POST', '/converse', params, json=context)
  File "/media/jh/data/lm-tools/wit-ai-3.4/venv/local/lib/python2.7/site-packages/wit/wit.py", line 23, in req
    ' (' + rsp.reason + ')')
wit.wit.WitError: Wit responded with status: 404 (Not Found)

@jhoelzl
Copy link
Contributor Author

jhoelzl commented Apr 18, 2016

Okay, got it. I have to make a new app (including the new story feature) for this example script. Now it works.

@jhoelzl jhoelzl closed this as completed Apr 18, 2016
@nkbem
Copy link

nkbem commented Apr 22, 2016

I have made a new app but can you tell me how to solve those problems?

@jhoelzl
Copy link
Contributor Author

jhoelzl commented Apr 22, 2016

@nkbem what errors did you get? You also have to use the client key for a wit app that contains the new story feature.

@gsquare94
Copy link

gsquare94 commented May 27, 2016

I already have an app that includes the new story feature. I still get the following error:
Traceback (most recent call last): File "examples\quickstart.py", line 44, in <module> client.interactive() File "C:\Python34\lib\site-packages\wit\wit.py", line 152, in interactive context = self.run_actions(session_id, message, context, max_steps) File "C:\Python34\lib\site-packages\wit\wit.py", line 126, in run_actions message) File "C:\Python34\lib\site-packages\wit\wit.py", line 119, in __run_actions user_message) File "C:\Python34\lib\site-packages\wit\wit.py", line 83, in __run_actions rst = self.converse(session_id, message, context) File "C:\Python34\lib\site-packages\wit\wit.py", line 75, in converse resp = req(self.access_token, 'POST', '/converse', params, json=context) File "C:\Python34\lib\site-packages\wit\wit.py", line 28, in req ' (' + rsp.reason + ')') wit.wit.WitError: Wit responded with status: 404 (Not Found)

rsp.reason() isn't showing anything. I'm using the server-access token as the only command line argument. Can anyone please specify what I'm doing wrong?

@tanisha96
Copy link

I got this error:

2017-06-23T18:02:59.574159+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/" host=dry-caverns-55926.herokuapp.com request_id=73ced7c3-0ebb-4d50-a837-497293270f27 fwd="66.220.152.165" dyno= connect= service= status=503 bytes= protocol=https
2017-06-23T18:03:42.654025+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/" host=dry-caverns-55926.herokuapp.com request_id=05e271c3-005e-40bb-bfc8-73a339a76924 fwd="173.252.90.91" dyno= connect= service= status=503 bytes= protocol=https
2017-06-23T18:04:19.406717+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/" host=dry-caverns-55926.herokuapp.com request_id=4e146a9b-8b9f-42b4-aadd-85a74ec27035 fwd="66.220.152.137" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2017-06-23T18:02:35.349699+00:00 app[web.1]: File "/app/utils.py", line 1, in
2017-06-23T18:02:35.349699+00:00 app[web.1]: from wit import Wit
2017-06-23T18:02:35.350421+00:00 app[web.1]: ModuleNotFoundError: No module named 'wit'
2017-06-23T18:02:35.356408+00:00 app[web.1]: [2017-06-23 18:02:35 +0000] [8] [INFO] Worker exiting (pid: 8)
2017-06-23T18:02:35.585199+00:00 app[web.1]: [2017-06-23 18:02:35 +0000] [4] [INFO] Shutting down: Master
2017-06-23T18:02:35.585721+00:00 app[web.1]: [2017-06-23 18:02:35 +0000] [4] [INFO] Reason: Worker failed to boot.
2017-06-23T18:02:35.720537+00:00 heroku[web.1]: Process exited with status 3
2017-06-23T18:02:35.733864+00:00 heroku[web.1]: State changed from up to crashed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants