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 #6815

Closed
dumabg opened this issue Oct 6, 2022 · 2 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. triage me I really want to be triaged.

Comments

@dumabg
Copy link

dumabg commented Oct 6, 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

@dumabg dumabg added the triage me I really want to be triaged. label Oct 6, 2022
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Oct 6, 2022
@tritone
Copy link
Contributor

tritone commented Oct 6, 2022

This code seems to be from the Firebase Admin SDK rather than this repo, so please file an issue over there instead at https://github.com/firebase/firebase-admin-go to get support.

@tritone tritone closed this as completed Oct 6, 2022
@dumabg
Copy link
Author

dumabg commented Oct 7, 2022

Opened: firebase/firebase-admin-go#514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants