shield icon indicating copy to clipboard operation
shield copied to clipboard

[BUG]plugin metashield - restore failure "GET /v2/import not found"

Open JCL38-ORANGE opened this issue 5 years ago • 6 comments

Describe the bug After a successful backup, I try restoring the backup

To Reproduce Steps to reproduce the behavior:

  1. Configure metashield system/job
  2. Launch backup job and check that it turns green
  3. Launch a restore job
  4. 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 endpoint GET /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

JCL38-ORANGE avatar May 12 '20 14:05 JCL38-ORANGE

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.

JCL38-ORANGE avatar May 13 '20 07:05 JCL38-ORANGE

Hello,

Is possible to have a feedback on this ? Thanks a lot and regards, JC.

JCL38-ORANGE avatar May 29 '20 07:05 JCL38-ORANGE

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?

jhunt avatar May 29 '20 11:05 jhunt

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.

JCL38-ORANGE avatar Jun 25 '20 16:06 JCL38-ORANGE

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.

JCL38-ORANGE avatar Jun 29 '20 15:06 JCL38-ORANGE

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.

jhunt avatar Jun 29 '20 18:06 jhunt