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

Persist X-Request-ID with the events that originated them #6420

Closed
SamuAlfageme opened this issue Apr 3, 2018 · 5 comments
Closed

Persist X-Request-ID with the events that originated them #6420

SamuAlfageme opened this issue Apr 3, 2018 · 5 comments
Assignees
Labels
blue-ticket Design & UX Enhancement ReadyToTest QA, please validate the fix/enhancement
Milestone

Comments

@SamuAlfageme
Copy link
Contributor

X-Request-ID was introduced in client v. 2.4: #5853 for tracing back and cross-referencing requests with the server logs. This can be seen as an extension of that to help users locate the cause of their issues together with admins.

Would it be possible to store this ID together with its originator event on the sync journal to allow some sort of "Copy X-Request-ID` when right-clicking an event from the "Activity > Not Synced" tab? (only in those cases that are strictly related to the server operation/network activity). This way is not strictly necessary to have the log window open or to be inspecting the network to get this ID.

e.g.

sqlite> select * from blacklist;
path        lastTryEtag  lastTryModtime  retrycount  errorstring                                                                                                                     X-Request-ID                                    lastTryTime  ignoreDuration  renameTarget  errorCategory
----------  -----------  --------------  ----------  --------------------------------------------------------------------------------------------------------------------            ----------------------------------------------  -----------  --------------  ------------  -------------
.htaccess                1522758480      2           Server replied "403 Forbidden" to "PUT https://localhost/remote.php/dav/files/admin/.htaccess" (Sabre\DAV\Exception\Forbidden)  4c5adb86-2a66-4450-9af9-f6f77b5bdf581522758593   125                           0

cc/ @michaelstingl

@guruz guruz added this to the 2.5.0 milestone Apr 3, 2018
@ogoffart ogoffart self-assigned this Apr 4, 2018
ogoffart added a commit that referenced this issue Apr 4, 2018
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
@guruz
Copy link
Contributor

guruz commented Apr 9, 2018

@ogoffart What about adding a column for the in .owncloudsync.log ?
And also modifying the server log templates (for apache, nginx) to show them in the server log file?

@SamuAlfageme
Copy link
Contributor Author

@guruz

And also modifying the server log templates (for apache, nginx) to show them in the server log file?

Makes complete sense, will open issues/poke people around to do so.

@SamuAlfageme
Copy link
Contributor Author

Link owncloud-docker/base#22

ogoffart added a commit that referenced this issue Apr 24, 2018
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
ogoffart added a commit that referenced this issue May 15, 2018
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
@ogoffart ogoffart added the ReadyToTest QA, please validate the fix/enhancement label May 15, 2018
@SamuAlfageme
Copy link
Contributor Author

WFM 👍


For reference, since @michaelstingl asked me: log rotation period is 2MB - all blacklist errors are meant to re-appear in there, but old errors that went away are not granted to be preserved; an error-only log might be an interesting idea to explore, but a different topic.

const qint64 logfileMaxSize = 1024 * 1024; // 1MiB
// Note; this name is ignored in csync_exclude.c
const QString filename = folderPath + QLatin1String(".owncloudsync.log");
// When the file is too big, just rename it to an old name.
QFileInfo info(filename);
bool exists = info.exists();
if (exists && info.size() > logfileMaxSize) {
exists = false;
QString newFilename = filename + QLatin1String(".1");
QFile::remove(newFilename);
QFile::rename(filename, newFilename);
}
_file.reset(new QFile(filename));

I fear most of the log contain not-so-useful info, but that's also a different topic:

#=#=#=# Syncrun started 2018-05-17T15:52:45Z
#=#=#=#=# Propagation starts 2018-05-17T15:52:46Z (last step: 857 msec, total: 857 msec)
#=#=#=# Syncrun finished 2018-05-17T15:52:46Z (last step: 12 msec, total: 870 msec)
#=#=#=# Syncrun started 2018-05-17T15:52:48Z
#=#=#=#=# Propagation starts 2018-05-17T15:52:48Z (last step: 322 msec, total: 322 msec)
#=#=#=# Syncrun finished 2018-05-17T15:52:48Z (last step: 36 msec, total: 359 msec)
#=#=#=# Syncrun started 2018-05-17T15:52:59Z
#=#=#=#=# Propagation starts 2018-05-17T15:52:59Z (last step: 267 msec, total: 267 msec)
15:53:03||cv_en.pdf|INST_NEW|Up|1506664574||23909||8|Upload of 23 KB exceeds the quota for the folder|507|0|0|aaa544b5-af30-4d0b-a6d0-18ab07c519a1|
#=#=#=# Syncrun finished 2018-05-17T15:53:00Z (last step: 410 msec, total: 678 msec)

@guruz
Copy link
Contributor

guruz commented May 24, 2018

FYI 74e412c 2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blue-ticket Design & UX Enhancement ReadyToTest QA, please validate the fix/enhancement
Projects
None yet
Development

No branches or pull requests

3 participants