Облачная служба разработчика и сборщик пакетов не работают с HTTP 401 Не авторизованы?
Моя сборка Oracle Developer не удалась и что-то говорилось о неавторизованном коде HTTP:
oracle-oci: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401
У моего упаковщика json build есть куча элементов, которые я только что установил, и куча из них имеет OCI
в строке...
"builders": [
{
"user_ocid":"ocid1.user.oc1..",
"tenancy_ocid": "ocid1.tenancy.oc1..",
"fingerprint":"0d:1e:...",
"key_file":"oci_api_key.pem",
"availability_domain": "uKbv:CA-TORONTO-1-AD-1",
"region": "us-ashburn-1",
"base_image_ocid": "ocid1.image.oc1.iad...",
"compartment_ocid": "ocid1.compartment.oc1..",
"image_name": "DevCS_MYSQL",
"shape": "VM.Standard2.2",
"ssh_username": "opc",
"ssh_password": "welcome1",
"subnet_ocid": "ocid1.subnet.oc1.ca-johnstown-1...",
"type": "oracle-oci"
}
],
Как определить, какой из них неправильный и вызывает неавторизованный код HTTP 401? Я не вижу ни одного из упомянутых элементов и не вижу
[2019-08-21 12:44:50] Build scheduled. Build started by user helpdeskaleer@gmail.com
[2019-08-21 12:44:50] Build task id: 830601c8-5ba8-4dc4-8bdc-07abaff9de73
[2019-08-21 12:55:03] Build execution started.
[2019-08-21 12:55:03] Building on slave PackerTerraformNodeJS
[2019-08-21 12:55:02] Git: Checkout directory is the workspace root.
[2019-08-21 12:55:02] Git: git version 1.8.3.1
[2019-08-21 12:55:02] Git: Fetching from remote repository https://mysqlalphaoffice-helpdeskaleer.developer.ocp.oraclecloud.com/mysqlalphaoffice-helpdeskaleer/s/mysqlalphaoffice-helpdeskaleer_mysql-alphaoffice_10254/scm/MYSQL-PackerTerraform.git
[2019-08-21 12:55:02] /bin/git fetch --no-tags https://mysqlalphaoffice-helpdeskaleer.developer.ocp.oraclecloud.com/mysqlalphaoffice-helpdeskaleer/s/mysqlalphaoffice-helpdeskaleer_mysql-alphaoffice_10254/scm/MYSQL-PackerTerraform.git +refs/heads/*:refs/remotes/origin/*
[2019-08-21 12:55:04] Git: Checking out branch master
[2019-08-21 12:55:04] Git: Done
[2019-08-21 12:55:04] BEGIN shell script execution with /bin/sh -ex
[2019-08-21 12:55:04] + packer --version
[2019-08-21 12:55:04] 1.3.5
[2019-08-21 12:55:04] + tee output.txt
[2019-08-21 12:55:04] + packer build build.json
[2019-08-21 12:55:05] [1;32moracle-oci output will be in this color.[0m
[2019-08-21 12:55:05] [1;32m==> oracle-oci: Creating temporary ssh key for instance...[0m
[2019-08-21 12:55:05] [1;32m==> oracle-oci: Creating instance...[0m
[2019-08-21 12:55:05] [1;31m==> oracle-oci: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401[0m
[2019-08-21 12:55:05] [1;31mBuild 'oracle-oci' errored: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401[0m
[2019-08-21 12:55:05] ==> Some builds didn't complete successfully and had errors:
[2019-08-21 12:55:05] --> oracle-oci: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401
[2019-08-21 12:55:05] ==> Builds finished but no artifacts were created.
[2019-08-21 12:55:05] + ls -l
[2019-08-21 12:55:05] total 56
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 2577 Aug 21 12:55 build.json
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 1406 Aug 21 12:55 compute.tf
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 888 Aug 21 12:55 datasources.tf
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 99 Aug 21 12:55 Dockerfile
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 786 Aug 21 12:55 env-vars
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 2983 Aug 21 12:55 network.tf
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 1675 Aug 21 12:55 oci_api_key.pem
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 450 Aug 21 12:55 oci_api_key_public.pem
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 1678 Aug 21 12:55 oci_instance_key
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 402 Aug 21 12:55 oci_instance_key.pub
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 488 Aug 21 12:55 outputs.tf
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 874 Aug 21 12:55 output.txt
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 260 Aug 21 12:55 provider.tf
[2019-08-21 12:55:05] -rw-r-----. 1 builder builder 1726 Aug 21 12:55 variables.tf
[2019-08-21 12:55:05] + cat output.txt
[2019-08-21 12:55:05] [1;32moracle-oci output will be in this color.[0m
[2019-08-21 12:55:05] [1;32m==> oracle-oci: Creating temporary ssh key for instance...[0m
[2019-08-21 12:55:05] [1;32m==> oracle-oci: Creating instance...[0m
[2019-08-21 12:55:05] [1;31m==> oracle-oci: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401[0m
[2019-08-21 12:55:05] [1;31mBuild 'oracle-oci' errored: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401[0m
[2019-08-21 12:55:05] ==> Some builds didn't complete successfully and had errors:
[2019-08-21 12:55:05] --> oracle-oci: Problem creating instance: Service error:NotAuthenticated. The required information to complete authentication was not provided or was incorrect.. http status code: 401
[2019-08-21 12:55:05] ==> Builds finished but no artifacts were created.
[2019-08-21 12:55:05] /data/cibuild/830601c8-5ba8-4dc4-8bdc-07abaff9de73/tmp/script5780075887420937130.sh: line 5: unexpected EOF while looking for matching ``'
[2019-08-21 12:55:05] Error: Command exited with status 2
[2019-08-21 12:55:05] END shell script execution
[2019-08-21 12:55:05] No artifacts requested
Slave log size 4.6 KB (4,622)
[2019-08-21 12:55:07]
[2019-08-21 12:55:07] Build completed.
[2019-08-21 12:55:07] Status: DONE Result: FAILED Duration: 5.0 sec
1 ответ
401 NotAuthenticated указывает, что есть проблема с одним из этих значений:
"user_ocid":"ocid1.user.oc1..",
"tenancy_ocid": "ocid1.tenancy.oc1..",
"fingerprint":"0d:1e:...",
"key_file":"oci_api_key.pem",
Все эти настройки используются для создания строки подписи, используемой для аутентификации в OCI. Когда эта аутентификация не проходит, вы получаете ответ 401 NotAuthenticated.