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

Bug report server script #3072

Merged
merged 6 commits into from
Feb 3, 2017
Merged

Bug report server script #3072

merged 6 commits into from
Feb 3, 2017

Conversation

kegsay
Copy link
Contributor

@kegsay kegsay commented Jan 26, 2017

Example logs (-0 is most recent, -3 is oldest):

$ ls -l
-rw-r--r--  1 kegan  staff   909 26 Jan 11:46 bugreport-20170126-114615-0.log.gz
-rw-r--r--  1 kegan  staff   524 26 Jan 11:46 bugreport-20170126-114615-1.log.gz
-rw-r--r--  1 kegan  staff  1761 26 Jan 11:46 bugreport-20170126-114615-2.log.gz
-rw-r--r--  1 kegan  staff   998 26 Jan 11:46 bugreport-20170126-114615-3.log.gz
-rw-r--r--  1 kegan  staff   198 26 Jan 11:46 bugreport-20170126-114615.log.gz

$ zless bugreport-20170126-114615.log.gz 
everything is awful.

Number of logs: 4
Version: UNKNOWN
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

$ zless bugreport-20170126-114615-0.log.gz 
2017-01-26T10:52:37.374Z I Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome.
2017-01-26T10:52:37.376Z I Vector starting at http://localhost:8080/#/room/!OvylurBpcFVXBQyEGv:localhost
2017-01-26T10:52:37.400Z I Routing URL http://localhost:8080/#/room/!OvylurBpcFVXBQyEGv:localhost
2017-01-26T10:52:37.408Z I Restoring session for %s @foobar2:localhost
2017-01-26T10:52:37.408Z I setLoggedIn => %s (guest=%s) hs=%s @foobar2:localhost false http://localhost:8008
2017-01-26T10:52:37.409Z I Session persisted for %s @foobar2:localhost
2017-01-26T10:52:37.549Z I SyncApi.sync: starting with sync token null
2017-01-26T10:52:37.554Z E Failed to poll for update [object Object]
2017-01-26T10:52:37.560Z I newscreen 
2017-01-26T10:52:37.573Z I Presence: %s online
2017-01-26T10:52:37.574Z I Got push rules
2017-01-26T10:52:37.677Z I MatrixClient sync state => %s PREPARED
2017-01-26T10:52:37.681Z I MatrixClient sync state => %s SYNCING
2017-01-26T10:52:37.683Z I newscreen room/!OvylurBpcFVXBQyEGv:localhost
2017-01-26T10:52:37.943Z I updateTint from RoomView._gatherTimelinePanelRef
2017-01-26T10:52:37.945Z I Tinter.tint from updateTint
2017-01-26T10:52:40.650Z I newscreen settings
2017-01-26T10:52:40.821Z I Failed to fetch app version [object Object]
2017-01-26T10:52:45.674Z I Sending bug report.
2017-01-26T10:52:48.065Z E Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the RoomView component.
2017-01-26T10:56:30.634Z I Presence: %s unavailable
2017-01-26T11:02:38.610Z E Failed to poll for update [object Object]
2017-01-26T11:10:12.410Z I Presence: %s online
2017-01-26T11:10:15.215Z I Sending bug report.
...

Rather than make the file names incredibly long (by adding ms),
just 500 it and expect the user to resend.
@ara4n
Copy link
Member

ara4n commented Jan 26, 2017 via email

@kegsay
Copy link
Contributor Author

kegsay commented Jan 26, 2017

What are the file size limits like when making issues on Github? We can obviously squeeze more out by gzipping like this does, but if it's an attachment then it's more faff to view (click to download, run through gzip or zless it rather than just clicking the attachment to view in the browser).

LMK where you want 'em and I'll send them in whatever form you want.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I guess

// "bugreport-20170115-112233-1.log.gz" => ...
// "bugreport-20170115-112233-N.log.gz" => oldest log
t := time.Now()
prefix := t.Format("bugreport-20060102-150405")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i assume this will be UTC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't actually, will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

func gzipAndSave(data []byte, filepath string) error {
if _, err := os.Stat(filepath); err == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be specifying a directory as an explicit option rather than just using the cwd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯\(ツ)/¯ maybe?

@kegsay
Copy link
Contributor Author

kegsay commented Jan 26, 2017

Hmm Github are suitably vague, mainly focusing on the limits for git repos: https://help.github.com/articles/what-is-my-disk-quota/

@ara4n
Copy link
Member

ara4n commented Jan 26, 2017 via email

@kegsay
Copy link
Contributor Author

kegsay commented Jan 26, 2017

@richvdh richvdh assigned kegsay and unassigned richvdh Jan 26, 2017
@kegsay
Copy link
Contributor Author

kegsay commented Jan 26, 2017

@ara4n Github's API does not allow you to upload attachments to issues, so we cannot realistically send bug reports to GH issues.

@kegsay
Copy link
Contributor Author

kegsay commented Feb 3, 2017

Merging as per:

kegan: wdyt about a cheap & cheerful soln to unblock rageshake? vdh's suggestion of just bunging them on disk for now

@kegsay kegsay merged commit 18ac71e into develop Feb 3, 2017
@t3chguy t3chguy deleted the kegan/rageshake-server branch May 12, 2022 08:56
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

Successfully merging this pull request may close these issues.

3 participants