Developer forum

Forum » Dynamicweb 10 » dw cli deploy issues

dw cli deploy issues

Jacob Nilsson
Reply

Hi. We're trying to use the dw cli for an azure devops release pipeline towards a dw cloud hosted site based on the tutorial on docs:
https://doc.dynamicweb.dev/documentation/tutorials/extending/workflows/setting-up-ci-cd.html

This gives me internal server errorr:
dw files -iro . / --host $(host) --apiKey $(apikey)

The api key has been generated on the site:s backoffice.

Not sure if there is some unupdated documentation and needs to be done in another way, some bug, environment issue or me that is the problem.

I've also tried to run it locally with the same issue occuring using:
dw files -iro . / --host thesite.staging.dynamicweb-cms.com --apiKey thekey

Response:
Response {
  size: 0,
  [Symbol(Body internals)]: {
    body: PassThrough {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 6,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    stream: PassThrough {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 6,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    boundary: null,
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    type: 'default',
    url: 'https://thesite.staging.dynamicweb-cms.com/Admin/Api/Upload?createEmptyFiles=false&createMissingDirectories=true',
    status: 500,
    statusText: 'Internal Server Error',
    headers: {
      'cache-control': 'no-cache,no-store',
      connection: 'close',
      'content-type': 'application/problem+json; charset=utf-8',
      date: 'Wed, 17 Sep 2025 09:07:43 GMT',
      expires: '-1',
      pragma: 'no-cache',
      'strict-transport-security': 'max-age=2592000',
      'transfer-encoding': 'chunked',
      'x-powered-by': 'ASP.NET'
    },
    counter: 0,
    highWaterMark: 16384
  }
}
Promise { <pending> }


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Jacob,

Sorry for the late response.

Your command looks correct, so as long as the site and key are both valid, it should work. In order for me to narrow it further, I would like to know a few things.

  • Which version of DynamicWeb 10 are you using?
  • Which version of the CLI are you using?
    You may need to manually look for the version number in %AppData%/npm/node_modules/@dynamicweb/cli/package.json.
  • Have you checked the log in Insights to see if there's an error message or stack trace that can give a clue?

It might also be helpful to have a link to the site. If you don't want to share it publicly here, you can send it to me directly. You can find my email address by hovering the mouse cursor over my name under my portrait.

- Jeppe

 
Jacob Nilsson
Reply

Which version of DynamicWeb 10 are you using?

This is for sites hosted in dw cloud. For this particular example we have a staging site copied from the production site so both shuld be ring 2. The production site is intended to be on hold for updates untill it is in ring 4. We're planning on using the release pipeline for both environments but are trying it out on the staging site untill we can get it to work. On a side note: The staging site seems to be down at the moment. I belive someone at dw care for using that for investingating a separate issue with database backups that did not work restoring and seems to have been left at the current state.

Which version of the CLI are you using?

For the release pipeline we're using npm install -g @dynamicweb/cli so that should always be the "latest version".
On my local computer this should have been 1.0.13 at the time running.
For the runs for today it should be: 1.0.15
 

Have you checked the log in Insights to see if there's an error message or stack trace that can give a clue?
This is the logs I get. Different log from when the thread was created. Still not working.

$ dw files -iro . / --host ***.staging.dynamicweb-cms.com --apiKey ***
Listing directory at: .
Uploading files
**some random files here**
C:\Projects\KvinnligtUnder\KvinnligtUnderSite\wwwroot\Files\isthisuploaded.txt
**some random files here**
(node:26604) [https://github.com/node-fetch/node-fetch/issues/1167] DeprecationWarning: form-data doesn't follow the spec and requires special treatment. Use alternative package
(Use `node --trace-deprecation ...` to show where the warning was created)
undefined:1
<!doctype html>
^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Response.json (file:///C:/Users/Jacob/AppData/Roaming/npm/node_modules/@dynamicweb/cli/node_modules/node-fetch/src/body.js:149:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async uploadFiles (file:///C:/Users/Jacob/AppData/Roaming/npm/node_modules/@dynamicweb/cli/bin/commands/files.js:274:21)
    at async processDirectory (file:///C:/Users/Jacob/AppData/Roaming/npm/node_modules/@dynamicweb/cli/bin/commands/files.js:124:9)
    at async handleFiles (file:///C:/Users/Jacob/AppData/Roaming/npm/node_modules/@dynamicweb/cli/bin/commands/files.js:106:17)

Might be some more logs on the hosting side that you can access. It is a DW hosted site.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Jacob,

I found the exception from the first post on the server, and it seems that you're doing something that tries to write to C:\Program Files\Git, which triggers an UnauthorizedAccessException. I can't tell where that path comes from, but it's not something that we inject in the CLI. You can see the error log yourself on the staging solution with this path:

/Admin/UI/Insights/EventViewerOverview?Id=284583&Type=LogEventById

The second post seems to indicate a different issue. There's no error log on the server, so it would indicate that the request never reaches the solution.

Since you're copying everything from the current folder, is there a chance that there are files or symbolic links in your source folder that shouldn't be included?

- Jeppe

 
Jacob Nilsson
Reply

Hi Jeppe,

I can assure you that I'm not doing anything other then using the cli with your exaple from your docs site. So the git folder would come from the implementation in either the dw-cli or DataCortroller or code they use.

The are no symlinks or junctions or things like that in the Files folder structure.

Having tried running it again now after your answer I get the same Unauthorized issue. I suspect that the reason for not getting anything in the log was what I wrote before:
"On a side note: The staging site seems to be down at the moment. I belive someone at dw care for using that for investingating a separate issue with database backups that did not work restoring and seems to have been left at the current state." At least that seems to have been solved now and I'm sure you ran into the same issue and fixed it. Thanks for that!

I'm adding a screenshot with the terminal, folder and log for your convenience. I'm genuinly just using your documentation and examples for this. But yeah, it's very peculiar that the Management API tries to create the git folder...

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

This is indeed strange. I've just tried to upload a couple of files using the CLI to your site, and it worked as expected.

I can share the uncensored image as well. Just let me know.

Again, this indicates to me that it has to do with the folder structure that is being uploaded. Can you try to upload just a single file or folder instead of the entire thing? Just to see what happens. If that doesn't tell us anything, we probably have to turn on full request logging on the site to see what is being sent.

- Jeppe

 
Jacob Nilsson
Reply

I tried uploading just one file and I got the same issue. Then I noticed that you are running the cli in PowerShell and I've been running it in bash. I tried running the commands in PowerShell instead and that works fine and can handle the whole folder structure. Seems like there is a bug in the cli that sends the folder of the terminal running it with bash (and explains why the cli passes git folder to the  API / DataCortroller for windows computers running it via git bash). Maybe a little disclaimer telling people to use PowerShell on the cli docs page could be handy and save people time and frustration untill this is fixed.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Good find!

I'll get that investigated and fixed. You can track the progress here: https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasenotes/workItemInfo.html?workitemid=25797

 
Anders Ebdrup
Reply

Dear Jeppe,

 

I guess that it is the same issue related to this thread: Upload file with CLI, so it will be nice to have investigated.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi all,

The result of the investigation turned out to be related to Get Bash, exactly as Jacob suggested. There is a quirk where it tries to change arguments if it sees something that looks like a relative path. We've added a new section to the readme on github and will be adding it to the documentation as well: https://github.com/dynamicweb/CLI?tab=readme-ov-file#using-git-bash

A new version of the CLI, 1.0.16, containing the warning and other fixes has been released. Feel free to pull it from NPM.

@Anders, I don't think your issue is related to this one. Unless you were using Git Bash (MINGW64), this would not have affected you.

- Jeppe

 

You must be logged in to post in the forum