outsideris/citizen

Duplicated (500) Access Denied error when uploading provider

Closed this issue · 2 comments

I run citizen server and citizen client from the same image (v0.4.0). Citizen server is running ok on /health page.
Im trying to upload any provider into citizen server to test citizen as terraform private provider registry, so i download zip file:
https://registry.terraform.io/v1/providers/hashicorp/random/2.0.0/download/linux/amd64
"download_url":"https://releases.hashicorp.com/terraform-provider-random/2.0.0/terraform-provider-random_2.0.0_linux_amd64.zip"

renamed zip file to hashicorp-random_2.0.0_linux_amd64.zip
And run such command and got access denied error:
citizen provider hashicorp random 2.0.0 4.0

✔ validate required files in /...../citizen-provider
Found:
hashicorp-random_2.0.0_linux_amd64.zip

  • generate hashicorp-random_2.0.0_SHA256SUMS file
    ✔ generate hashicorp-random_2.0.0_SHA256SUMS file
  • sign hashicorp-random_2.0.0_SHA256SUMS file with gpg
    ✔ sign hashicorp-random_2.0.0_SHA256SUMS file with gpg
  • retriving GPG public key for your GPG
    ✔ retriving GPG public key for your GPG
  • publish hashicorp/random/2.0.0
    (node:542) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
    (Use citizen --trace-warnings ... to show where the warning was created)
    ✖ publish hashicorp/random/2.0.0
    Duplicated (500)Access Denied

in citizen logs i can see such messages:

{
"level": 50,
"time": 1646467680641,
"pid": 7,
"hostname": "ip-XXXX.eu-central-1.compute.internal",
"name": "AccessDenied",
"Code": "AccessDenied",
"RequestId": "TF9WYRXXXXXX",
"HostId": "6cnC28cLrM+NZ1VvV9b0kyg5XXXXXX",
"$fault": "client",
"$metadata": {
"httpStatusCode": 403,
"extendedRequestId": "6cnC28cLrM+NZ1VvV9XXXXXXXX",
"attempts": 1,
"totalRetryDelay": 0
},
"stack": "AccessDenied: Access Denied\n at deserializeAws_restXmlPutObjectCommandError
(/snapshot/citizen/node_modules/@aws-sdk/client-s3/dist/cjs/protocols/Aws_restXml.js:8254:41)\n
at runMicrotasks ()\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n
at async /snapshot/citizen/node_modules/@aws-sdk/middleware-serde/dist/cjs/deserializerMiddleware.js:6:20\n
at async /snapshot/citizen/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:11:20\n
at async StandardRetryStrategy.retry (/snapshot/citizen/node_modules/@aws-sdk/middleware-retry/dist/cjs/StandardRetryStrategy.js:51:46)\n
at async /snapshot/citizen/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22\n
at async saveProvider (/snapshot/citizen/storages/s3.js)\n
at async /snapshot/citizen/routes/providers.js\n
at async Promise.all (index 1)\n
at async Form. (/snapshot/citizen/routes/providers.js)",
"type": "Error",
"msg": "Access Denied"
}
{
"level": 50,
"time": 1646467680643,
"pid": 7,
"hostname": "ip-XXX.eu-central-1.compute.internal",
"name": "citizen",
"msg": "AccessDenied: Access Denied\n
at deserializeAws_restXmlPutObjectCommandError (/snapshot/citizen/node_modules/@aws-sdk/client-s3/dist/cjs/protocols/Aws_restXml.js:8254:41)\n
at runMicrotasks ()\n
at processTicksAndRejections (internal/process/task_queues.js:95:5)\n
at async /snapshot/citizen/node_modules/@aws-sdk/middleware-serde/dist/cjs/deserializerMiddleware.js:6:20\n
at async /snapshot/citizen/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:11:20\n
at async StandardRetryStrategy.retry (/snapshot/citizen/node_modules/@aws-sdk/middleware-retry/dist/cjs/StandardRetryStrategy.js:51:46)\n
at async /snapshot/citizen/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22\n
at async saveProvider (/snapshot/citizen/storages/s3.js)\n
at async /snapshot/citizen/routes/providers.js\n
at async Promise.all (index 1)\n
at async Form. (/snapshot/citizen/routes/providers.js)"
}
�[0mPOST /v1/providers/hashicorp/random/2.0.0 �[31m500�[0m 406.800 ms - 28�[0m

Could you please advise ?

i tried renamed
from hashicorp-random_2.0.0_linux_amd64.zip
to hashicorp-random_2.0.1_linux_amd64.zip
and tried command citizen provider hashicorp random 2.0.1 4.0
and got the same access denied error. Any advise ?

i fixed issue by added s3 full permissions for the role which running citizen server.