tmolnar0831 / photter

Photter is a small IRC BOT
0 stars 1 forks source link

Error message causes flood protection to trigger, kicking the bot #24

Closed gustafe closed 5 years ago

gustafe commented 5 years ago

Trying to query an unknown location gives the following error

==> 13:17 < Coraxyn> Thanks Gustaf 13:17 < gustaf> .weather Isle of Man 13:17 <+pg-bot> Sorry, I got an error: The value of VECTOR is "<!DOCTYPE html> Quits: pg-bot

Message in REPL:

==> UNHANDLED-EVENT:3757580221: PRIVMSG: Coraxyn #photogeeks "Thanks Gustaf" UNHANDLED-EVENT:3757580224: ERR_UNKNOWNCOMMAND: cherryh.freenode.net pg-bot "Unknown command" UNHANDLED-EVENT:3757580224: ERR_UNKNOWNCOMMAND: cherryh.freenode.net pg-bot "Unknown command" UNHANDLED-EVENT:3757580224: ERR_UNKNOWNCOMMAND: cherryh.freenode.net pg-bot Runtime "Unknown command" UNHANDLED-EVENT:3757580224: ERR_UNKNOWNCOMMAND: cherryh.freenode.net pg-bot <meta "Unknown command" UNHANDLED-EVENT:3757580224: ERROR: "Closing Link: 165.227.165.91 (Excess Flood)"</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/tmolnar0831"><img src="https://avatars.githubusercontent.com/u/250972?v=4" />tmolnar0831</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <st_iron> .weather isle of man <photter-dev> Sulby, Isle of Man, Partly cloudy, 4.3°C, feels like -2.3°C, wind 50.8kph NW, precipitation 0.0mm, humidity 62%, UV 2.0 </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/tmolnar0831"><img src="https://avatars.githubusercontent.com/u/250972?v=4" />tmolnar0831</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I tried a series of problematic commands in the test room with OQ, but we cannot reproduce the issue.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gustafe"><img src="https://avatars.githubusercontent.com/u/8576740?v=4" />gustafe</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>Output should still be limited to 3 or 4 lines (even errors) to prevent a denial of service attack on the bot. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/tmolnar0831"><img src="https://avatars.githubusercontent.com/u/250972?v=4" />tmolnar0831</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>It seems that the main issue is the "newline" character in the response from HTTP. It must be stripped first, because the IRCd treats it as a command evaluation. The bot can split the long output to chunks of messages.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gustafe"><img src="https://avatars.githubusercontent.com/u/8576740?v=4" />gustafe</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>Another example... </p> <p><a href="https://github.com/tmolnar0831/photter/files/2802799/error.txt">error.txt</a></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/tmolnar0831"><img src="https://avatars.githubusercontent.com/u/250972?v=4" />tmolnar0831</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <h1>25 fixes it.</h1> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/tmolnar0831"><img src="https://avatars.githubusercontent.com/u/250972?v=4" />tmolnar0831</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I close it now, it can be reopened if necessary.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>