-
Notifications
You must be signed in to change notification settings - Fork 217
Fix issue where there is no error checking bucket exists in GCSDataStore #299
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
Conversation
When the bucket exists then `error` is `null` which causes this code to fail with an error `TypeError: Cannot read properties of null (reading 'code')`. We are using `"@google-cloud/storage": "^6.5.2",` but there's no harm in checking if a variable is not null before trying to access a property.
|
Sorry, I don't know why the test runs are failing - seems to be a timeout issue. Don't know how quick releases are made - this seems to be a fairly well maintained product :). But I am going to sadly have to downgrade the version until this can be patched coz my docker won't run. Hope this helps |
|
Thank you for this fix. This was recently changed. I wonder how that went past our tests. I recommend we also take a look at tests to see why this didn't trigger any errors. Yeah, CI is grumpy sometimes :) |
It happens in the constructor - is that mocked somehow in the tests? Or maybe the bucket it's checking in the tests always throws this 403 error? |
|
I guess your docker does not start because you have installed Thrown errors are unhandled and silently ignored. Intended behavior can not work as bucket existence can not be asynchronously checked in constructor. I recommend that we print warning message with logger and continue. Test should handle |
Yes we have an |
|
Are you able to handle the test part of this? I'm a PHP dev by trade, learning JS and no idea how to approach this beyond I found the error and think I fixed it :) |
|
Sure. We'll handle the rest. |
|
Tests handle unhandled errors everywhere else but not in this function. Not sure why is this so. This behavior is also inconsistent with S3 which reports error when uploading a file. I'll make a separate issue to discuss this and accept this PR. |
|
@angelsk Version 0.8.1 is released. It should fix your issues. |
* 1.x: 0.8.1 Fix validation of upload-length header in patch handler (#303) Bump @google-cloud/storage from 6.4.1 to 6.5.2 (#304) Bump aws-sdk from 2.1206.0 to 2.1227.0 (#305) Revert "Bump tus-js-client from 2.3.1 to 3.0.0" (#302) Emit upload complete event when using creation-with-upload extension (#301) GCS: fix error handling when checking for bucket existence (#299)
Thank you! |
When the bucket exists then
errorisnullwhich causes this code to fail with an errorTypeError: Cannot read properties of null (reading 'code').We are using
"@google-cloud/storage": "^6.5.2",but there's no harm in checking if a variable is not null before trying to access a property.This is with the latest
"tus-node-server": "^0.8.0",release