We hit a strange error, if we upload a large image (larger than 1G), the glance_store will hit a error:Unicode-objects must be encoded before hashing. But if the image is small enough, the error won't happen.
After dig into the code, it appears that when chunk reading the image data, the date piece may be non-byte, so the checksum.updating will raise the error.
encoding the date piece to ensure it's byte can solve the problem.
env: master branch, Glance using swift backend.
We hit a strange error, if we upload a large image (larger than 1G), the glance_store will hit a error:Unicode- objects must be encoded before hashing. But if the image is small enough, the error won't happen.
error log: /www.irccloud. com/pastebin/ jP3DapNy/
https:/
After dig into the code, it appears that when chunk reading the image data, the date piece may be non-byte, so the checksum.updating will raise the error.
encoding the date piece to ensure it's byte can solve the problem.