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

smart selftest log parsing error during self tests #1207

Closed
phillxnet opened this Issue Mar 6, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@phillxnet
Member

phillxnet commented Mar 6, 2016

Some hdd models eg Seagate ST3000VN000 update their Self-Test logs during a test rather than only after the test is complete. But this live update is not elegantly dealt with by the current parsing system and causes the following error to be thrown directly after initiating a self test:

Error!

invalid literal for int() with base 10: "

this blocks smart refreshes for the drive in question during the period of the self test (ie up to 6.6 hours) and is due to a parser failing to split the appropriate fields.

A normal line output from /usr/sbin/smartctl -l selftest -l selective /dev/sda:

#7  Conveyance offline  Completed without error       00%      1032         -

A problematic line is of the form:

#1  Conveyance offline  Self-test routine in progress 10%         6         -

Given we currently split by multiple space the problematic "Self-test routine in progress 10%" is read as a single entry as all other columns can be split by multiple spaces but in this case we have only one between the "progress" and "10%", this in turn leads to an error as the following field is wrongly assumed to be a percentage.

I have started to approach this issue and hope to make more progress soon.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 6, 2016

@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 7, 2016

N.B. Only had a quick look at this since opening but looks like the indicated error is only generated in the fist 9 hours of drive life, ie single digit drive lifetime. But parsing of the self test log is still faulty there after, only without generating the error.

The following is the result of the current parsing while a test is active and the drive is 2 digit hours old.

1   Short offline   Self-test routine in progress 10%   99  -1    (empy last column)

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 8, 2016

add specialized parser for in progress smart self test log entry rock…
…stor#1207

Detect when we have failed to retrieve all 6 columns and if the cause
is down to in-progress test log entry then do additional parsing to
re-create our expected 6 columns. Cause is down to splitting on two
or more spaces and in this instance we have only one space between
columns. Special case so treat as such.
@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 8, 2016

Using an edited file dump of the output from /usr/sbin/smartctl -l selftest -l selective /dev/sda I have recreated the original smartcrt output and with TESTMODE = True proved the above specialize parser for this circumstance. The following previously problematic Self-Test log entry:

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Self-test routine in progress 80%         6                  -

is now correctly parsed as follows:

Test # Type         Status                                % Completed   Lifetime hours  LBA of the first error
1      Short offline    Self-test routine in progress  20                   6                   -

in the Self-Test Logs entry (spaces added here to help readability).

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 8, 2016

schakrava added a commit that referenced this issue Mar 15, 2016

Merge pull request #1213 from phillxnet/1207_smart_selftest_log_parsi…
…ng_error

smart selftest log parsing error. Fixes #1207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment