Bug 1478060 - Can't upload swift-rings to swift container.
Summary: Can't upload swift-rings to swift container.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-swift
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 10.0 (Newton)
Assignee: Thiago da Silva
QA Contact: Mike Abrams
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-03 13:51 UTC by Robin Cernin
Modified: 2020-09-10 11:06 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-29 16:15:19 UTC
Target Upstream Version:
Embargoed:
tshefi: automate_bug-


Attachments (Terms of Use)

Description Robin Cernin 2017-08-03 13:51:58 UTC
Hello,

Update fails on updating swift-rings from overcloud to undercloud on curl command, when we tried to execute the same command and upload swift-rings manually we noticed the temp_url_expires= is not updated and refer to past:

---
[root@overcloud-controller deployed]# grep -ri temp_url_expires ./*
./02a4c5b5-2306-45de-a556-92b93f9d9415.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=860f3578477fe152a4b44f83deeb1df97cdb5dba&temp_url_expires=1500373594",
./27370724-fa97-4d8b-a4dc-34295034e6ea.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/copy_ssh_key-308eec5e-cceb-408f-be2b-59dfe2b169ae/ee91c11b-b77e-4ce9-98a0-02a7e34ef42e?temp_url_sig=15203e315a6646b61f92c527276b2f632ecd97de&temp_url_expires=1501085632",
./35f51d8f-0be9-491d-b5cd-9a8c2435a5e5.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/copy_ssh_key-2aeacd0d-df08-4e37-8a9d-b8d629c8a337/e17d10d7-2ce3-4899-9fe0-bb8f061d3420?temp_url_sig=e615de4fec3b4d05d2b53c57d9da5e47fd1baab1&temp_url_expires=1500302539",
./516e0ef5-1a8e-471c-9b6b-2aedddb1e817.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=eb87d0cd5e1fba1874ba8086bfd13bc1dac5d0b1&temp_url_expires=1501154364",
./519adfd2-a857-47f8-aba1-e7c71f450f3f.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=69bb32e4beda570c05a6a89b955879c726b6bd40&temp_url_expires=1501154366",
./5c69234d-c9b1-42b9-bebe-f13de51bf749.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=69bb32e4beda570c05a6a89b955879c726b6bd40&temp_url_expires=1501154366",
./64672ea4-ff82-414b-9523-9e33f8830d33.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=69bb32e4beda570c05a6a89b955879c726b6bd40&temp_url_expires=1501154366",
./cd4d7956-a115-44bf-b54d-5025d32771eb.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=860f3578477fe152a4b44f83deeb1df97cdb5dba&temp_url_expires=1500373594",
./d3dd3f07-fbd7-493e-b89b-9a357d65cce0.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=eb87d0cd5e1fba1874ba8086bfd13bc1dac5d0b1&temp_url_expires=1501154364",
./d9615c83-ea1c-4780-b13c-c68c9c8ad9c8.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=69bb32e4beda570c05a6a89b955879c726b6bd40&temp_url_expires=1501154366",
./f3ef30fb-95fe-4bd9-8c22-fc8c01aaa25c.json:      "value": "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=633d52ef7dc8ca5a8a03d31c58a7fe9b3dadc29a&temp_url_expires=1500373592",
---

---
[root@overcloud-controller heat-config-script]# cat d9615c83-ea1c-4780-b13c-c68c9c8ad9c8
#!/bin/sh
TMP_DATA=$(mktemp -d)
function cleanup {
  rm -Rf "$TMP_DATA"
}
trap cleanup EXIT
# sanity check in case rings are not consistent within cluster
swift-recon --md5 | grep -q "doesn't match" && exit 1
pushd ${TMP_DATA}
tar -cvzf swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/*
resp=`curl --insecure --silent -X PUT "${swift_ring_put_tempurl}" --write-out "%{http_code}" --data-binary @swift-rings.tar.gz`
popd
if [ "$resp" != "201" ]; then
    exit 1
fi
---

---
[root@overcloud-controller heat-config-script]# curl --insecure -X PUT "https://undercloud_publicURL:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=69bb32e4beda570c05a6a89b955879c726b6bd40&temp_url_expires=1501154366" --write-out "%{http_code}" --data-binary @swift-rings.tar.gz
401 Unauthorized: Temp URL invalid
---

---
$ date -d @1501154366
Thu Jul 27 07:19:26 EDT 2017
---

Comment 8 Robin Cernin 2017-08-04 11:55:39 UTC
[stack@director ~]$ swift stat overcloud-swift-rings | grep "Temp-Url-Key"
Meta Temp-Url-Key: tempurl_key

[stack@director ~]$ swift tempurl PUT 3600 /v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings tempurl_key
/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings?temp_url_sig=0e93a5c324a3f7c0ab59747c4017285188ac573b&temp_url_expires=1501848001

[stack@director ~]$ date
Fri Aug  4 13:00:15 CEST 2017

[stack@director ~]$ date -d @1501848001
Fri Aug  4 14:00:01 CEST 2017

[root@overcloud-controller heat-admin]# tar -cvzf swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/*
tar: Removing leading `/' from member names
/etc/swift/account.builder
/etc/swift/container.builder
/etc/swift/object.builder
/etc/swift/account.ring.gz
/etc/swift/container.ring.gz
/etc/swift/object.ring.gz
/etc/swift/backups/1499760290.object.builder
/etc/swift/backups/1499760291.container.builder
/etc/swift/backups/1499760292.account.builder
/etc/swift/backups/1499760295.account.builder
/etc/swift/backups/1499760295.account.ring.gz
/etc/swift/backups/1499760295.container.builder
/etc/swift/backups/1499760295.container.ring.gz
/etc/swift/backups/1499760295.object.builder
/etc/swift/backups/1499760295.object.ring.gz

[root@overcloud-controller heat-admin]# curl --insecure --silent -X PUT "https://undercloudip:port/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings?temp_url_sig=0e93a5c324a3f7c0ab59747c4017285188ac573b&temp_url_expires=1501848001" --write-out "%{http_code}" --data-binary @swift-rings.tar.gz
401 Unauthorized: Temp URL invalid
401

Comment 9 Sachin 2017-08-07 05:46:13 UTC
Robin,

Can you try including full path of object when creating temp-url,
~~~
# swift tempurl PUT 3600 /v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz tempurl_key
~~~

Comment 10 Jelle Hoylaerts 2017-08-07 06:10:59 UTC
Hello,

Unfortunately, this gives the same error.

[stack@director ~]$ swift stat overcloud-swift-rings | grep "Temp-Url-Key"
Meta Temp-Url-Key: 68004855-0aa5-4429-9d65-faabfb16f9d6
[stack@director ~]$ swift tempurl PUT 3600 /v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz tempurl_key
/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=e9ee69f231abc314f5a73dc2c06d22ce532c7dcd&temp_url_expires=1502089441
[stack@director ~]$ date
Mon Aug  7 08:04:04 CEST 2017
[stack@director ~]$ date -d @1502089441
Mon Aug  7 09:04:01 CEST 2017
[root@controller0]# tar -cvzf swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/*                                                       tar: Removing leading `/' from member names
/etc/swift/account.builder
/etc/swift/container.builder
/etc/swift/object.builder
/etc/swift/account.ring.gz
/etc/swift/container.ring.gz
/etc/swift/object.ring.gz
/etc/swift/backups/1499760290.object.builder
/etc/swift/backups/1499760291.container.builder
/etc/swift/backups/1499760292.account.builder
/etc/swift/backups/1499760295.account.builder
/etc/swift/backups/1499760295.account.ring.gz
/etc/swift/backups/1499760295.container.builder
/etc/swift/backups/1499760295.container.ring.gz
/etc/swift/backups/1499760295.object.builder
/etc/swift/backups/1499760295.object.ring.gz
[root@controller0]# curl --insecure -X PUT "https://10.101.21.135:13808/v1/AUTH_0ae8e2f716e6437cbdbdead30cded831/overcloud-swift-rings/swift-rings.tar.gz?temp_url_sig=e9ee69f231abc314f5a73dc2c06d22ce532c7dcd&temp_url_expires=1502089441" --write-out "%{http_code}" --data-binary @swift-rings.tar.gz
401 Unauthorized: Temp URL invalid


Note You need to log in before you can comment on or make changes to this bug.