You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python version and virtual environment information python --version
Python 2.7.6
google-cloud-python version pip show google-cloud, pip show google-<service> or pip freeze
Name: google-cloud-bigtable
Version: 0.22.0
Stacktrace if available
Traceback (most recent call last):
File "bt.py", line 13, in <module>
row = bt_table.read_row('mykey')
File "/home/jungho.ahn/tmp/test/local/lib/python2.7/site-packages/google/cloud/bigtable/table.py", line 234, in read_row
rows_data.consume_all()
File "/home/jungho.ahn/tmp/test/local/lib/python2.7/site-packages/google/cloud/bigtable/row_data.py", line 323, in consume_all
self.consume_next()
File "/home/jungho.ahn/tmp/test/local/lib/python2.7/site-packages/google/cloud/bigtable/row_data.py", line 275, in consume_next
self._validate_chunk(chunk)
File "/home/jungho.ahn/tmp/test/local/lib/python2.7/site-packages/google/cloud/bigtable/row_data.py", line 390, in _validate_chunk
self._validate_chunk_row_in_progress(chunk)
File "/home/jungho.ahn/tmp/test/local/lib/python2.7/site-packages/google/cloud/bigtable/row_data.py", line 370, in _validate_chunk_row_in_progress
_raise_if(not chunk.timestamp_micros or not chunk.value)
File "/home/jungho.ahn/tmp/test/local/lib/python2.7/site-packages/google/cloud/bigtable/row_data.py", line 441, in _raise_if
raise InvalidChunk(*args)
google.cloud.bigtable.row_data.InvalidChunk
It's tough to say without actually seeing the failed chunk. Can you run this with a debugger? It may be easiest to just dump it in a script and run python -m pdb script_name.py or to run it in IPython and use the %debug magic after it fails.
@tseaver The culprit is exactly as described by @junghoahnsc. I don't quite recognize the validation since it was re-worked for v2 while I was on "paternity leave". Is there a reason we don't allow empty cells on read?
UPDATE: I just verified that writing an empty cell works:
Hi, I am trying to run this step by step:
The PartialRowData object's state is "row in progress"
The chunk it currently processing has only "qualifier" and "timestamp_micros". "reset_now" is False, no "commit_row" field, "value" is empty.
The error is triggered in _validate_chunk_row_in_progress method:
if not chunk.HasField('commit_row') and not chunk.reset_row:
_raise_if(not chunk.timestamp_micros or not chunk.value)
Is there any workaround until it is fixed? @dhermes do you need any more information from our side? Actually our bigtable was written by Go/Java apps and now we're trying to read it in Python.
Is there any way you can validate the same read using Go or Java? Just to gain confidence that the fix I suggested will work... And/or can you just remove those checks from your local copy and verify?
@garye there is no issue in reading in Go/Java. @dhermes Here is the output of all_responses. I trimmed it since it's private data. Plz let me know if you need full output.
Regarding my earlier comment, @garye and I spoke offline. While there's no such thing as a Bigtable cell with an value, someone can set a filter that strips the value; that's useful in cases where all you want to do is check for existence of a row.
The check for value should be removed as well as @garye suggested. I authored an implementation guide which may be incorrect. Sorry about that.
Activity
dhermes commentedon Feb 2, 2017
It's tough to say without actually seeing the failed chunk. Can you run this with a debugger? It may be easiest to just dump it in a script and run
python -m pdb script_name.pyor to run it in IPython and use the%debugmagic after it fails.junghoahnsc commentedon Feb 2, 2017
Actually the value is an empty string.
dhermes commentedon Feb 2, 2017
Gotcha, ISTM the chunk is equivalent to:
dhermes commentedon Feb 2, 2017
@tseaver The culprit is exactly as described by @junghoahnsc. I don't quite recognize the validation since it was re-worked for
v2while I was on "paternity leave". Is there a reason we don't allow empty cells on read?UPDATE: I just verified that writing an empty cell works:
but then reading this row doesn't fail either (because the chunk type must be different):
@junghoahnsc The state of the chunks is also relevant here, so I need a little more info to reproduce.
tseaver commentedon Feb 2, 2017
Too much water under the bridge since June :). I think we need to ask @garye, @mbrukman, or @sduskis. The context is:
yuanbaisc commentedon Feb 2, 2017
Hi, I am trying to run this step by step:
The PartialRowData object's state is "row in progress"
The chunk it currently processing has only "qualifier" and "timestamp_micros". "reset_now" is False, no "commit_row" field, "value" is empty.
yuanbaisc commentedon Feb 2, 2017
The error is triggered in _validate_chunk_row_in_progress method:
if not chunk.HasField('commit_row') and not chunk.reset_row:
_raise_if(not chunk.timestamp_micros or not chunk.value)
garye commentedon Feb 3, 2017
Yeah I think the chunk and timestamp check there is invalid.
junghoahnsc commentedon Feb 3, 2017
Is there any workaround until it is fixed?
@dhermes do you need any more information from our side? Actually our bigtable was written by Go/Java apps and now we're trying to read it in Python.
garye commentedon Feb 3, 2017
Is there any way you can validate the same read using Go or Java? Just to gain confidence that the fix I suggested will work... And/or can you just remove those checks from your local copy and verify?
sduskis commentedon Feb 3, 2017
A timestamp of 0 is valid. I think that there needs to be a chunk.value.
garye commentedon Feb 3, 2017
Timestamp of 0 is fine and empty value for chunk.value is fine, but I think "not chunk.value" is true if it's an empty string which is wrong.
sduskis commentedon Feb 3, 2017
empty values are not fine in these cases. An empty cell isn't a thing in BT. If there's no reset, there needs to be a value, IIRC.
dhermes commentedon Feb 3, 2017
@junghoahnsc @yuanbaisc Can you consume the response using the low-level API?
UPDATE: If there is private data returned, you can redact it or feel free to email me (email in my GitHub profile)
junghoahnsc commentedon Feb 3, 2017
@garye there is no issue in reading in Go/Java.
@dhermes Here is the output of
all_responses. I trimmed it since it's private data. Plz let me know if you need full output.sduskis commentedon Feb 3, 2017
Regarding my earlier comment, @garye and I spoke offline. While there's no such thing as a Bigtable cell with an value, someone can set a filter that strips the value; that's useful in cases where all you want to do is check for existence of a row.
The check for value should be removed as well as @garye suggested. I authored an implementation guide which may be incorrect. Sorry about that.
junghoahnsc commentedon Feb 4, 2017
IIUC, it looks like the current validation check is not correct. Is it easy to remove that?
Or should we use a low-level api until it is fixed?
garye commentedon Feb 9, 2017
@dhermes @tseaver I put a PR together for this, can you take a look? We've heard from other users offline that are being impacted by the bug.
Remove invalid chunk validation
Remove invalid chunk validation