shield
shield copied to clipboard
[BUG]plugin metashield - restore failure "GET /v2/import not found"
Describe the bug After a successful backup, I try restoring the backup
To Reproduce Steps to reproduce the behavior:
- Configure metashield system/job
- Launch backup job and check that it turns green
- Launch a restore job
- The restore job turns green but in fact there is an error
...
DEBUG> 'restore' action returned error: SHIELD API endpoint
GET /v2/import' not found SHIELD API endpointGET /v2/import' not found ...
Expected behavior restore job must turn green without error
SHIELD versions
- SHIELD Core: 8.7.2
- SHIELD Cli: 8.7.2
Hello,
When I curl the import endpoint : curl -k -X GET https://shield.internal.paas/v2/import {"error":"SHIELD API endpoint `GET /v2/import' not found"}
When I curl the export endpoint : curl -k -X GET https://shield.internal.paas/v2/export {"error":"Authorization required"}
Regards, Jean-Christophe.
Hello,
Is possible to have a feedback on this ? Thanks a lot and regards, JC.
I am unable to reproduce this in 8.7.0, or 8.7.2. Reviewing the pertinent code, I can see no way for the metashield plugin to ever make a GET request to /v2/import -- are you running a private fork of Open Source SHIELD?
Hello James, Sorry for my late answer. We are running the official release and I still have the issue. Is it normal that I can't curl the https://shield.internal.paas/v2/import ? Following is my target/job configuration which works at backup time but not at restore time :
- type: replace path: /instance_groups/name=shield/jobs/name=import/properties/import/tenants/0/systems/- value: name: ((deployment_name))-meta-(ip) agent: (ip):5444 plugin: metashield config: url: http://((static_ip)) token: daa9a25d-8f52-4b9a-b9c8-2730e0e4a9eb core_ca_cert: ((shield-ca.certificate)) summary: "Metashield backup" jobs: - name: ((deployment_name))-meta-full-daily when: ((when)) policy: four-days-term retain: 3 storage: local-((deployment_name))-(ip) paused: false
DEBUG> --key '/2020/06/25/2020-06-25-031725-c3a5154d-e9c0-4b60-99c0-b76cf969600d'
connecting to s3...
DEBUG> 'restore' action returned error: SHIELD API endpoint GET /v2/import' not found SHIELD API endpoint GET /v2/import' not found
retrieving backup archive
from path '/2020/06/25/2020-06-25-031725-c3a5154d-e9c0-4b60-99c0-b76cf969600d
in bucket 'fe-int-backup-shieldv8'
streaming backup archive to standard output
retrieved 74 bytes of data
EXITING 4 ERR> remote execution failed: Process exited with status 4
Thanks and regards, Jean-Christophe.
Hello,
Maybe the problem is linked to the token required for the metashield plugin.
Is it possible to use a generated token for the metashield plugin and how (bosh context) ?
Thanks and regards,
Jean-Christophe.
The token shouldn't be a problem; the issue seems to be an impossible one. Somehow you've got a compiled copy of the metashield plugin that is incorrectly issuing a GET request to the /v2/import endpoint (which should be a POST, instead) -- but I cannot for the life of me figure out where in the code it could be misconstruing it that badly.