Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JCL38-ORANGE opened this issue May 12, 2020 · 6 comments
Open
Labels
triage Issues that are pending triage / validation by a SHIELD contributor
Milestone

Comments

@JCL38-ORANGE
Copy link

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 JCL38-ORANGE added the triage Issues that are pending triage / validation by a SHIELD contributor label May 12, 2020
@JCL38-ORANGE
Copy link
Author

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
Copy link
Author

Hello,

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

@jhunt
Copy link
Contributor

jhunt commented May 29, 2020

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?

@JCL38-ORANGE
Copy link
Author

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.

@jhunt jhunt added this to the v9 milestone Jun 26, 2020
@JCL38-ORANGE
Copy link
Author

JCL38-ORANGE commented Jun 29, 2020

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.

@jhunt
Copy link
Contributor

jhunt commented Jun 29, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues that are pending triage / validation by a SHIELD contributor
Development

No branches or pull requests

2 participants