yukuku / telebot

Telegram Bot starter kit. Very easy to install with Google App Engine.
Apache License 2.0
689 stars 234 forks source link

Internal Server Error #9

Closed fawwaz closed 8 years ago

fawwaz commented 9 years ago

I follow your steps untill deploying to appengine and i got a message like this :

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~digital-mutabaah/1.385654266843284493/main.py", line 48, in get
    self.response.write(json.dumps(json.load(urllib2.urlopen(BASE_URL + 'getMe'))))
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized
ADTC commented 9 years ago

Is your token line correct? I got this same error, and found that I didn't put my token in. Change:

TOKEN = 'YOUR_BOT_TOKEN_HERE'

to

TOKEN = '123456789:AAG90e14-0f8-40183D-18491dDE'

(actually, whatever the BotFather gave you when you created your new bot). Take care to keep the quotes.

Deploy again.

fawwaz commented 9 years ago

Yes i changed it. But i guess the Telegram server is currently get DDoS attack. I opened http://api.telegram.org/bot<MYTOKEN>/GetMe and got "Unauthorized" . Not sure how long this issue still remain.

ADTC commented 9 years ago

Is your <MYTOKEN> really in the format 12345678:ABC1dEFGhiJ2KlMNo345PqrsTuvwXyZAb6C?

https://api.telegram.org/bot12345678:ABC1dEFGhiJ2KlMNo345PqrsTuvwXyZAb6C/getMe

It should work, if the URL is like this. Otherwise, check your token value from BotFather chat again. Try copying the above dummy URL into Notepad and replacing the token.

If still not working, try again later. Telegram is getting DDoS attacks, but my bot worked fine.

hammadzz commented 9 years ago

This is an outstanding issue. The url works with my token but I get the exact same error above. Few other people on reddit reported it as well. There is a bug here somewhere.

anuj9196 commented 9 years ago

I am too getting the same error after successfully deploying to Google App Engine. accessing

http://api.telegram.org/botMYTOKEN/GetMe

I am getting 504 Gateway Time-out error

accessing https://google-app-engine-id.appspot.com/me gives these error

Traceback (most recent call last): File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 267, in Handle result = handler(dict(self._environ), self._StartResponse) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in call rv = self.router.dispatch(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in call return handler.dispatch() File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch return method(_args, _kwargs) File "/base/data/home/apps/s~the-born-engineer-bot/1.386964511721426348/main.py", line 48, in get self.response.write(json.dumps(json.load(urllib2.urlopen(BASE_URL + 'getMe')))) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 404, in open response = self._open(req, data) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 422, in _open '_open', req) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 382, in _call_chain result = func(_args) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 1222, in https_open return self.do_open(httplib.HTTPSConnection, req) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 1187, in do_open r = h.getresponse(buffering=True) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/gae_override/httplib.py", line 522, in getresponse _extra_kwargs) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 271, in fetch return rpc.get_result() File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result return self.get_result_hook(self) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 378, in _get_fetch_result rpc.check_success() File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 584, in check_success self.stubmap.GetPostCallHooks().Call(self.service, self.__method, File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 246, in GetPostCallHooks return self.postcall_hooks DeadlineExceededError

yukuku commented 8 years ago

Wait for a while. In my experience telegram needs time to set up new bots.