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

What to do with No tasks found. ? #125

Open
patrickelectric opened this issue Jan 21, 2018 · 10 comments
Open

What to do with No tasks found. ? #125

patrickelectric opened this issue Jan 21, 2018 · 10 comments

Comments

@patrickelectric
Copy link

Fresh install, No tasks found. appear with bottery run.

@rougeth
Copy link
Owner

rougeth commented Jan 21, 2018

Hi @patrickelectric, you ran bottery startproject <name>, configured your bot token on settings.py and executed bottery run? This message indicates that something on configurations step didn't work (e.g. setting polling mode on Telegram platform).

I understand that the message isn't helpful at all. I'll take a look and try to make it better.

Thanks for opening the issue.

@patrickelectric
Copy link
Author

patrickelectric commented Jan 21, 2018

I have a local computer running the code without problems.
Maybe can be something related with my vps ? Both settings are identical.
Code struct:

wilson
├── bot.py
├── getnet.py
├── __pycache__
│   ├── bot.cpython-35.pyc
│   ├── getnet.cpython-35.pyc
│   └── settings.cpython-35.pyc
└── settings.py

You can check my settings here.

@rougeth
Copy link
Owner

rougeth commented Jan 21, 2018

My guess would be something related to the polling mode. Since it keeps requesting updates from Telegram API, could the VPS be thinking your are DDoSing them?

I would suggest you to use webhook mode. Almost no changes on settings.py, but you would need to expose your bot on port 80 or 88 (ref) (we don't support SSL yet, sorry about that).

Update your version of bottery (0.1.0a10), I just published this --port feature (:
$ bottery run --port 80

HOSTNAME = 'your.vps.ip'  # changing here
     
SECRET_KEY = 'super-secret-key'
 
PLATFORMS = {
    'telegram': {
        'ENGINE': 'bottery.platform.telegram',
        'OPTIONS': {
            'token': 'I have my token here !',
            'mode': 'webhook',  # changing here
        }
    },
}

@patrickelectric
Copy link
Author

patrickelectric commented Jan 21, 2018

Same error..
I don't know if this can help, but running the local bot, and starting the vps bot, the local one returns:

January 01, 2018 -  21:17:49
Bottery version 0.0.1a9
Server running at http://localhost:7000
Quit the bot with CONTROL-C
Task exception was never retrieved
future: <Task finished coro=<TelegramEngine.polling() done, defined at /usr/lib/python3.6/site-packages/bottery/platform/telegram/engine.py:74> exception=KeyError('result',)>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/bottery/platform/telegram/engine.py", line 91, in polling
    tasks = [self.message_handler(msg) for msg in updates['result']]
KeyError: 'result'

@rougeth
Copy link
Owner

rougeth commented Jan 22, 2018

Oh, I thought it was working on your local machine. The token you put on settings.py is exactly as you got from BotFather? This is probably the case.

@patrickelectric
Copy link
Author

patrickelectric commented Jan 22, 2018

Sorry, probably I was not clear enough.
Yes, the bot is working in my local machine, this error appear in my local machine when I start the vps bot. My conclusion is that the vps bot start the communication with the telegram server, that's why my local bot exit. I don't know if this information can help, just a plus.

@rougeth
Copy link
Owner

rougeth commented Jan 22, 2018

Alright, when you said same error did you mean the No tasks found problem? I don't know how Telegram reacts when there are two different machines making request for its API but I do know that it only works on one mode at the time, polling or webhook.

@romulocollopy
Copy link

I have the same error running on heroku. I coundn't emulate it locally, thought.
It is very possible I've ran two machines at the same time with the bot, but I only get this error in production.
The worst part is heroku stops the process after some error, and the bot goes offiline for a while (from minutes to hours).

To me would be enough to silence this error and continue, but I'm yet studing how can I do this.

@romulocollopy
Copy link

#168

@romulocollopy
Copy link

romulocollopy commented Jul 1, 2018

I just realized that revoke the token and generate a new one can solve this problem

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

3 participants