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

Conversation

@Kegsay
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

ara4n commented Jan 26, 2017

@Kegsay

This comment has been minimized.

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 left a comment

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")

This comment has been minimized.

Copy link
@richvdh

richvdh Jan 26, 2017

Member

i assume this will be UTC?

This comment has been minimized.

Copy link
@Kegsay

Kegsay Jan 26, 2017

Author Contributor

It won't actually, will fix.

This comment has been minimized.

Copy link
@Kegsay

Kegsay Jan 26, 2017

Author Contributor

Done.

}

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

This comment has been minimized.

Copy link
@richvdh

richvdh Jan 26, 2017

Member

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

This comment has been minimized.

Copy link
@Kegsay

Kegsay Jan 26, 2017

Author Contributor

¯\(ツ)/¯ maybe?

@Kegsay

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

ara4n commented Jan 26, 2017

@Kegsay

This comment has been minimized.

Copy link
Contributor Author

Kegsay commented Jan 26, 2017

@richvdh richvdh assigned Kegsay and unassigned richvdh Jan 26, 2017
@Kegsay

This comment has been minimized.

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

This comment has been minimized.

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
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.