Snowflake: Can't use the stage (S3) - SQL compilation error: Stage does not exist or not authorized

Viewed 1858

I create an external stage in Snowflake via (I've tried with a public bucket too)

CREATE OR REPLACE stage "DATABASE"."SCHEMA"."STAGE_NAME"
    url='s3://bucket'
    CREDENTIALS=(AWS_KEY_ID='xxxxxxxxxxxx' AWS_SECRET_KEY='xxxxxxxxxxxx'); 

I could view the parameters of this stage via

SHOW STAGES

DESC STAGE "DATABASE"."SCHEMA"."STAGE_NAME"

However, I'm getting the error whenever I'm trying to interact with this stage (e.g., LIST @STAGE_NAME or load a file).

SQL compilation error: Stage 'DATABASE.SCHEMA.STAGE_NAME' does not exist or not authorized.

I've tried different snowflake roles but can't make it work. Could anyone point me where to look? Perhaps I have to assign any permissions to the stage?

3 Answers

It's pretty weird, but I can list a stage if the name consists of capital letters. No additional permissions are needed.

Works fine

CREATE OR REPLACE stage "DATABASE"."SCHEMA"."STAGE_NAME"
    url='s3://bucket'
    CREDENTIALS=(AWS_KEY_ID='xxxxxxxxxxxx' AWS_SECRET_KEY='xxxxxxxxxxxx'); 
LIST @STAGE_NAME

Returns Stage does not exist or not authorized.

CREATE OR REPLACE stage "DATABASE"."SCHEMA"."Stage_Name"
    url='s3://bucket'
    CREDENTIALS=(AWS_KEY_ID='xxxxxxxxxxxx' AWS_SECRET_KEY='xxxxxxxxxxxx'); 
LIST @Stage_Name

At the same time, I see all Stages while running the "SHOW STAGES" command.

Are there any constraints on the naming? I haven't found any so far.

Related