adobe / adobe/aio-cli-plugin-aem-cloud-service-migration

Dispatcher migration does not work fails with file already exists in Target folder exception

Open
#23 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21
Forks
11
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour

aio aem-migration:dispatcher-converter --type=ams

Dispatcher should be converted to cloud ready once after executing the following command.

### Actual Behaviour

Seeing the following error when running

aio aem-migration:dispatcher-converter --type=ams

```
patriquelegault@Patriques-MacBook-Pro-2 src % aio aem-migration:dispatcher-converter --type=ams
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
(node:11863) SyntaxError Plugin: @adobe/aio-cli-plugin-aem-rde: Unexpected token '||='
module: @oclif/core@1.26.2
task: toCached
plugin: @adobe/aio-cli-plugin-aem-rde
root: /Users/patriquelegault/.local/share/@adobe/aio-cli/node_modules/@adobe/aio-cli-plugin-aem-rde
See more details with DEBUG=*
› Warning: @adobe/aio-cli update available from 9.2.0 to 9.3.0.
› Run npm install -g @adobe/aio-cli to update.

********** Executing Dispatcher Converter **********
Converting Dispatcher Configurations...
Found usage of undefined variable:
target/dispatcher/src/conf.d/available_vhosts/aem_com.vhost:${COM_HOST}

Apache configuration uses non-whitelisted directives:
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:5
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:5
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:10
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:11
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:11
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:42
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:43
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:43
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:93
target/dispatcher/src/conf.d/available_vhosts/all_mos.vhost:162
FileOperationsUtility: Commented out all usages of non-whitelisted directives listed above.
Error: EEXIST: file already exists, mkdir 'target/dispatcher/src/conf.dispatcher.d/enabled_farms'
Code: EEXIST
```

aem-migration-config.yaml

```
dispatcherConverter:
sdkSrc: /Users/patriquelegault/Documents/aem-sdk/cloud/author/aem-sdk-2023.8.13323.20230831T134651Z-230800/dispatcher-sdk-2.0.184/src
ams:
cfg: "/Users/patriquelegault/Desktop/disp/src_disp"
```

### Reproduce Scenario (including but not limited to)

Please reach out to me for the sample Dispatcher configuration used to reproduce the issue. I used the dispatcher sdk version dispatcher-sdk-2.0.184 as input source and a dispatcher version used for on prem.

#### Platform and Version

Src: dispatcher-sdk-2.0.184

#### Sample Code that illustrates the problem

I can provide you with a sample dispatcher configuration on demand.

#### Logs taken while reproducing problem

[result.log](https://github.com/adobe/aio-cli-plugin-aem-cloud-service-migration/files/12700976/result.log)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `aio aem-migration:dispatcher-converter --type=ams` with the provided `aem-migration-config.yaml`, dispatcher SDK 2.0.184, and the sample configuration requested in the issue. Review `result.log` and the `EEXIST` failure for `target/dispatcher/src/conf.dispatcher.d/enabled_farms`; done means the conversion completes and produces a cloud-ready Dispatcher configuration without the directory-creation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.