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

storage: bucket.Objects always returns "bucket doesn't exist" when using Firebase Emulator #5208

Closed
abhis3 opened this issue Nov 3, 2022 · 2 comments
Assignees

Comments

@abhis3
Copy link
Contributor

abhis3 commented Nov 3, 2022

I have a function that deletes some objects. This function works well, but when is used with Firebase Emulator, always return "bucket doesn't exist".

go 1.16

Code

e.g.

    storage, err := fire.DefaultFirebaseApp.Storage(ctx)
	if err != nil {
		return err
	}
	bucket, err := storage.DefaultBucket()
	if err != nil {
		return err
	}
	it := bucket.Objects(ctx, &cloudStorage.Query{
		Prefix: 'images/img',
	})
	for {
		attrs, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			return err
		}
		err = bucket.Object(attrs.Name).Delete(ctx)
		if err != nil {
			return err			
		}
	}
	return nil

Expected behavior
Code working with Firebase Emulator

@abhis3
Copy link
Contributor Author

abhis3 commented Nov 3, 2022

@dumabg this will be the tracking bug for firebase/firebase-admin-go#514

@abhis3
Copy link
Contributor Author

abhis3 commented Nov 3, 2022

Issue was fixed with #5209

@dumabg Please try again once we cut a new version of the emulator, or download the latest version straight from Github if you need it sooner

@abhis3 abhis3 closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant