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

Error in project setup #38

Open
spandl opened this issue Jul 19, 2019 · 29 comments
Open

Error in project setup #38

spandl opened this issue Jul 19, 2019 · 29 comments
Labels
bug Something isn't working

Comments

@spandl
Copy link

spandl commented Jul 19, 2019

After having installed dscc-gen viz I am getting prompted with the project name.

However, when I insert the name of the dev bucket the setup returns an error.

I made however sure that gs://dscc-test/testViz is a valid address, I can download a file from this bucket (manifest.json)

MacBook-Pro-2:Data Studio Community Component  ralph$ npx @google/dscc-gen viz
npx: installed 342 in 13.913s
? Project name testViz
? What is your dev bucket? gs://dscc-test/testViz(node:78492) 

Error Message

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at InputPrompt.onError (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/inquirer/lib/prompts/input.js:95:35)
    at SafeSubscriber._next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Observable.js:66:21)
    at SafeSubscriber.__tryOrUnsub (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:143:22)
    at Subscriber._next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at TakeUntilSubscriber.Subscriber._next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at TakeUntilSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at FilterSubscriber._next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/operators/filter.js:52:30)
    at FilterSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at RefCountSubscriber.Subscriber._next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at RefCountSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Subject.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subject.js:60:25)
    at ConnectableSubscriber.Subscriber._next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at ConnectableSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/Users/ralph/.npm/_npx/78492/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
(node:78492) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:78492) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@musiciancodes
Copy link
Contributor

Quick debug question: what is the (node:78492) at the end of your bucket name?

@spandl
Copy link
Author

spandl commented Jul 19, 2019

I think it is just a missing line jump

Before enter
image

After Enter
image

@musiciancodes
Copy link
Contributor

What is the output of:

npx @google/dscc-gen -v

Also -

Does it work if you do:

npx --ignore-existing @google/dscc-gen viz ?

@spandl
Copy link
Author

spandl commented Jul 19, 2019

npx @google/dscc-gen -v

npx: installed 342 in 15.354s
2.0.17

npx --ignore-existing @google/dscc-gen viz

(node:91771) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at InputPrompt.onError (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/inquirer/lib/prompts/input.js:95:35)
    at SafeSubscriber._next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Observable.js:66:21)
    at SafeSubscriber.__tryOrUnsub (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:143:22)
    at Subscriber._next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at TakeUntilSubscriber.Subscriber._next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at TakeUntilSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at FilterSubscriber._next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/operators/filter.js:52:30)
    at FilterSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at RefCountSubscriber.Subscriber._next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at RefCountSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Subject.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subject.js:60:25)
    at ConnectableSubscriber.Subscriber._next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:89:26)
    at ConnectableSubscriber.Subscriber.next (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/Users/ralph/.npm/_npx/91771/lib/node_modules/@google/dscc-gen/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
(node:91771) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:91771) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@musiciancodes
Copy link
Contributor

I'm able to reproduce this on a Macbook, but the error doesn't stop me from continuing. I'll keep looking into the exception, but you should be able to answer the next question, press "return", and continue on workflow.

@spandl
Copy link
Author

spandl commented Jul 19, 2019

OK, that is at least one step forward.

However, I can't get to the next question, when pressing enter.
Also, if I go a step back (same question is asked again) and I press return, nothing happens.

I have to Ctrl-C to get out

@musiciancodes
Copy link
Contributor

Once the error message finishes printing, press the up arrow key and it should re-prompt you with the prod bucket question. Fill that out, then press Enter. I know it's a workaround, but at least you'll have a working template at the end of this.

@spandl
Copy link
Author

spandl commented Jul 19, 2019

The up-arrow (or return key) works, but hitting then enter after the question is answered is not working here. Tried many keys to get going, all negative.

@albutko
Copy link

albutko commented Jul 22, 2019

Experiencing the exact same error/issues with the specs listed below

OS: MacOS - Mojave 10.14.5
npm: 6.10.1
dscc-gen: 2.0.17

Reprompting the dev bucket input with ↑ and pressing Enter does nothing.

@musiciancodes
Copy link
Contributor

Are you still getting it (as of basically now)?

@albutko
Copy link

albutko commented Jul 22, 2019

Nope! The error seems to be resolved. I was able to successfully run npx @google/dscc-gen viz

@spandl
Copy link
Author

spandl commented Jul 22, 2019

I have still the same issue. I even upgraded npm to the exact same specs as @albutko.
Same OS, same npm, same dscc-gen

I also created a new empty folder gs://dscc-test/viz2 with no luck. Same error message.

@albutko
Copy link

albutko commented Jul 22, 2019

UPDATE: I jumped the gun on calling it resolved. I successfully ran the command for one visualization, but on further attempts this error persists.

@musiciancodes
Copy link
Contributor

I made some updates and deployed a new version of the tool today. It's been working for the past few hours on my Macbook Pro. @albutko / @spandl are you seeing the same errors as before?

@spandl
Copy link
Author

spandl commented Jul 24, 2019

Nope, sorry, still getting the exact same error. Tried with different folders again

It tells me -v 2.0.18

@albutko
Copy link

albutko commented Aug 22, 2019

Any updates on this? Still having this issue with version 2.0.19

Screen Shot 2019-08-22 at 11 59 59 AM

After the warning is thrown I try to prompt the prod bucket question with the up arrow but the dev bucket question is reprompted.

@musiciancodes musiciancodes added the bug Something isn't working label Oct 24, 2019
@musiciancodes
Copy link
Contributor

What node/npm versions are y'all using?

@spandl
Copy link
Author

spandl commented Oct 24, 2019

npm -version
6.10.1

@spandl
Copy link
Author

spandl commented Oct 24, 2019

I am now actually getting a new error:
>> Error: Command failed with exit code 1 (EPERM): gsutil acl get gs://dscv

@musiciancodes
Copy link
Contributor

I suspect that this: #72 is related, but will need further investigation to make sure.

@musiciancodes
Copy link
Contributor

Can you try again? We made a ton of changes and I literally just redeployed.

@spandl
Copy link
Author

spandl commented Nov 26, 2019

MacBook-Pro-2:Data Studio Community Component  ralph$ npx @google/dscc-gen viz
npx: installed 347 in 11.039s
? Project name DSCV
? What is your dev bucket? gs://
>> Error: Command failed with exit code 1 (EPERM): gsutil acl get gs://dscv

I also tried
npx --ignore-existing @google/dscc-gen viz

Anything else I should try?

@musiciancodes
Copy link
Contributor

musiciancodes commented Nov 26, 2019 via email

@spandl
Copy link
Author

spandl commented Nov 26, 2019

I can do stuff like
gcloud projects list --format="json" \

and do get a valid list back. Haven't tried anything else.

@spandl
Copy link
Author

spandl commented Nov 26, 2019

And I managed to upload a file as well.
gsutil cp README.md gs://dscv/
Operation completed over 1 objects/938.0 B.

@clemlem
Copy link

clemlem commented Jun 11, 2020

I had the same issue. When you check how they validate permission in

export const hasBucketPermissions = async (
, they use the cmd gsutil acl get gs://<your bucket> which produces a 400 error if your bucket has a uniform bucket-level access. Try creating your bucket with gsutil mb -b off -l <your region> gs://<your bucket name> and it should work

@kdfriedman
Copy link

This may be a trivial suggestion but have you tried running gcloud auth login before attempting to install dscc-gen viz ? I was encountering the same issue and realized I hadn't set proper authentication for accessing my buckets.

@kmclaugh
Copy link

I had the same issue. When you check how they validate permission in

export const hasBucketPermissions = async (

, they use the cmd gsutil acl get gs://<your bucket> which produces a 400 error if your bucket has a uniform bucket-level access. Try creating your bucket with gsutil mb -b off -l <your region> gs://<your bucket name> and it should work

Confirmed, this worked for me

@aschor
Copy link

aschor commented Sep 1, 2022

I had the same issue. When you check how they validate permission in

export const hasBucketPermissions = async (

, they use the cmd gsutil acl get gs://<your bucket> which produces a 400 error if your bucket has a uniform bucket-level access. Try creating your bucket with gsutil mb -b off -l <your region> gs://<your bucket name> and it should work

Hi,

in my case, my organization REQUIRES buckets to be created with uniform bucket-level access. So I cannot create one without, there is an org constraint on that.

So basically I'm stuck even before starting. whoops. does anyone have another option please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants