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

Getting "Network or Certificate Error" with Staging sfcc.instance.upload #12

Closed
davidwitt-demandpdx opened this issue Nov 7, 2018 · 2 comments

Comments

@davidwitt-demandpdx
Copy link

I am able to successfully run a site import to my sandbox using the same script.

  1. I authorize to get a token
  2. I zip up my site data
  3. I start the upload with sfcc.instance.upload
  4. I run the import with sfcc.instance.import

This all works properly on my sandbox with OCAPI data API and WebDAV permissions setup to match what is in the README.md for this repo.

When I switch to using a staging url for the instance: cert.staging..demandware.net, I get the error and log:

Error: Network or certificate error
Error: An error occured. Try running the command again with -D,--debug flag.

I also have a script that uploads code using sfcc.code.deploy() using the same authentication methods for STG, and that works without issue.

I think I can rule out:

  1. WebDAV permissions since there are the same for dev01 and STG
  2. OCAPI permissions since the token generation works
  3. 2FA failure since the code deploy using the .p12 file and passphrase works for code.deploy(), but not for instance.upload()
  4. An issue with the sitedata_STG.zip since the data zip uploads successfully to dev01.

Can you look into this and let me know what the issue could be?

@davidwitt-demandpdx
Copy link
Author

I did verify that webdav works (and 2fa works) by uploading an image to a library for my STG instance:

function uploadTestFile() {
    return new Promise((resolve, reject) => {
        sfcc.webdav.upload(
            instance,
            '/Libraries/testLibraryTwo/default/images',
            './Lucy.jpg',
            sfcc_token,
            uploadOptions,
            function(error) {
                if (error) {
                    console.log(chalk.red('an error occurred uploading'));
                    reject(error);
                } else {
                    console.log('File upload complete');
                    resolve();
                }
            }
        )
    });
}

Relevant webdav permissions:

{  
  "clients":[
    {
      "client_id":"<client id>",
      "permissions":
      [
        {
          "path": "/impex",
          "operations": [
            "read_write"
          ]
        },
        {
          "path": "/cartridges",
          "operations": [
            "read_write"
          ]
        },
        {
          "path": "/libraries/testLibraryTwo",
          "operations": [
            "read_write"
          ]
        }
      ]
    }
  ]
}

@davidwitt-demandpdx davidwitt-demandpdx changed the title Getting "Network or Certificate Error" with Staging sfcc.instance.upload Getting "Network or Certificate Error" with Staging sfcc.instance.import Nov 14, 2018
@davidwitt-demandpdx davidwitt-demandpdx changed the title Getting "Network or Certificate Error" with Staging sfcc.instance.import Getting "Network or Certificate Error" with Staging sfcc.instance.upload Nov 14, 2018
@davidwitt-demandpdx
Copy link
Author

I mistakenly thought the error was due to the upload. The actual error is due to the sfcc.instance.import() function. I will open a new issue with relevant information there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant