Summary
While trying to push the source code of a Wave Template to a scratch org, I hit the following error: Expected template metadata file [template-info.json] located in path [waveTemplates/Halosight/].. However, the file in question did in fact exist within the specified path and I had no idea why sfdx was unable to locate the file within the path. After a fair amount of troubleshooting I found out that for some reason there is some type of char limit on the file path of the working directory, and if the path is too long, certain elements (i.e. the template-info.json file) will not be located. My original file path was /Users/halosight/Desktop/Halosight/Salesforce OPs/EinsteinApps/halosighteinsteinapp/force-app/main/default/waveTemplates/Halosight. I then shortened the file path by moving the project to my desktop: /Users/halosight/Desktop/halosighteinsteinapp/force-app/main/default/waveTemplates/Halosight and lo and behold the push went through successfully. I replicated this several times to ensure that this was an issue with the length of the working directory path and received the same results every time.
Steps To Reproduce:
- Push a Wave Template from the source code to an org.
- Make sure your working directory path is really long.
- Push will fail. Now shorten the path and it will succeed.
Expected result
Push should succeed regardless of path length.
Actual result
Push fails for some reason if path is too long.
Additional information
SFDX CLI Version: sfdx-cli/7.72.0-697e9faee2 darwin-x64 node-v12.18.3
SFDX plugin Version:
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/analytics 0.22.0
@salesforce/lwc-dev-server 2.5.1
├─ @oclif/plugin-update 1.3.10
└─ @oclif/plugin-help 2.2.1
@salesforce/sfdx-trust 3.2.1 (core)
analytics 1.12.0 (core)
config 1.1.6 (core)
generator 1.1.3 (core)
salesforcedx 49.8.0
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
├─ custom-metadata 1.0.8
├─ templates 49.4.4
└─ salesforce-alm 49.8.0
sfdx-cli 7.72.0 (core)
OS and version: Mac OS Catalina 10.15.6
Summary
While trying to push the source code of a Wave Template to a scratch org, I hit the following error:
Expected template metadata file [template-info.json] located in path [waveTemplates/Halosight/].. However, the file in question did in fact exist within the specified path and I had no idea why sfdx was unable to locate the file within the path. After a fair amount of troubleshooting I found out that for some reason there is some type of char limit on the file path of the working directory, and if the path is too long, certain elements (i.e. the template-info.json file) will not be located. My original file path was/Users/halosight/Desktop/Halosight/Salesforce OPs/EinsteinApps/halosighteinsteinapp/force-app/main/default/waveTemplates/Halosight. I then shortened the file path by moving the project to my desktop:/Users/halosight/Desktop/halosighteinsteinapp/force-app/main/default/waveTemplates/Halosightand lo and behold the push went through successfully. I replicated this several times to ensure that this was an issue with the length of the working directory path and received the same results every time.Steps To Reproduce:
Expected result
Push should succeed regardless of path length.
Actual result
Push fails for some reason if path is too long.
Additional information
SFDX CLI Version: sfdx-cli/7.72.0-697e9faee2 darwin-x64 node-v12.18.3
SFDX plugin Version:
OS and version: Mac OS Catalina 10.15.6