HackMD
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • More (Comment, Invitee)
    • Publishing
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions
    • Transfer ownership
    • Delete this note
    • Template
    • Save as template
    • Insert from template
    • Export
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Sharing Help
Menu
Options
Versions Transfer ownership Delete this note
Export
Google Drive Export to Google Drive Gist
Import
Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
More (Comment, Invitee)
Publishing
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: cofacts --- # 2018/10/21 Cofacts chatbot incident report ## Incident 1 LINE bot does not respond when URL is attached ### Problem 文武在 10/21 15:00 發現很多的 error。調查發現只要 `ListArticle` 查詢含有 URL,就會有錯誤: ``` { "data": { "ListArticles": null }, "errors": [ { "message": "Cannot destructure property title of 'undefined' or 'null'.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "ListArticles" ], "authError": false } ] } ``` ### Analysis SSH 進機器撈 url-resolver 的 log 看,發現跟 socket 斷裂相關的 error: https://github.com/cofacts/url-resolver/issues/9 研判是 puppeteer 與 headless chromium 之間的 websocket close 的關係。 ### 處理 透過 docker-compose 把 `url-resolver` 重啟之後即正常。 ### 追蹤 1. Rollbar 中仍然有零星的「`Cannot destructure property `title` of 'undefined' or 'null'.`」發生: https://rollbar.com/mrorz/rumors-line-bot/items/19/occurrences/56553337227/ 2. 將 websocket error 記至 github issue 待修,否則未來可能還會再發生。 https://github.com/cofacts/url-resolver/issues/9 ## Incident 2. LINE bot does not remember the context after user submitted content ### Problem 傳一則新訊息之後,跳出問理由的對話窗。輸入理由之後,卻又鬼打牆說找不到,要我們輸入理由。 ![](https://g0vhackmd.blob.core.windows.net/g0v-hackmd-images/upload_252e8553b9d4d14c712b54ec1a5abb54 =250x) ### Analysis 判斷是 bot 的 redis 不知為何沒有把對話 context 記下來。 連到 Heroku dashboard,亦可確認此狀況: ![](https://g0vhackmd.blob.core.windows.net/g0v-hackmd-images/upload_d6f174566775e1db40065b4113740371) Heroku redis 的免費版 quota 是 25 mb,看起來已經滿了。 ### 處理 根據[文件](https://devcenter.heroku.com/articles/heroku-redis#maxmemory-policy),heroku redis 在到達上限之後預設的行為是噴 error。因此我們使用下面指令將其行為改成「刪掉最舊的」。 ``` $ heroku redis:maxmemory redis-concave-55484 -a rumors-line-bot -p allkeys-lru ``` ## 後續追蹤 為何 redis error 沒有在 rollbar? 需要再追蹤。 是這個嗎:https://rollbar.com/mrorz/rumors-line-bot/items/96/

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.


Upgrade

All
  • All
  • Team
No template.

Create a template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

Sign in via GitHub

New to HackMD? Sign up

Help

  • English
  • 中文
  • 日本語

Documents

Tutorials

Book Mode Tutorial

Slide Example

YAML Metadata

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions

Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.