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

Open
dumabg opened this issue Oct 7, 2022 · 4 comments
Assignees

Comments

@dumabg
Copy link

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

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@christhompsongoogle
Copy link

@tonyjhuang FYI

@abhis3
Copy link

abhis3 commented Nov 3, 2022

This is an emulator issue, created firebase/firebase-tools#5208

@abhis3
Copy link

abhis3 commented Nov 3, 2022

@christhompsongoogle I don't have permissions for some reason, mind closing this out?

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

6 participants