Repository navigation
Description
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
Activity
mdonnalley commentedon Nov 30, 2020
@gmpmovies I was unable to reproduce the issue when the file path to the wave template was 152 characters long (the path you referenced was 130 characters long)
Are you still able to reproduce the issue with the latest cli (
[email protected]and[email protected])? If so, can you provide a sample project that reliably recreates the issue?no-response commentedon Dec 7, 2020
This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.
jandolina commentedon Dec 14, 2020
I am still seeing this issue. When a user runs my plugin with -h, it shows the help messages and exits with an error before any code runs in the 'run' function. Is there any more info on this bug?
gmpmovies commentedon Dec 14, 2020
Current CLI and Plugin Versions:
I attempted this again, and received the same results. I do not believe I can share my exact code example being that it is part of a managed package that we are creating. However, to be clear, this issue occurs when running our CI/CD proccess. I have a bash file that creates a scratch org and then installs the source code of our app. If I run the CI/CD script in a folder that has a long file path with this command
sfdx force:source:push -f || printf "${red}\nAn error occured while pushing the source to the org. The script will attempt to continue.\n${normal}", I get this exact error:Expected template metadata file [template-info.json] located in path [waveTemplates/Halosight/].. But when I run the script in a folder with a shorter file path (in my desktop for example), it will run without problems.mshanemc commentedon Oct 25, 2021
@gmpmovies are you able to still reproduce this? We don't need your actual metadata, just something that's long enough to fail (it can be just one file of any metadata type that'll cause the error).
And have you only ever caused it with
waveTemplates?no-response commentedon Nov 1, 2021
This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.
seamusocionnaigh commentedon Mar 9, 2022
Hi @mshanemc - I'm encountering this error now, using version: sfdx-cli/7.141.1 win32-x64 node-v16.14.0
The work-around by @gmpmovies didn't work for me (I moved my project to the C: drive)
The template-info is observed in the logs:
{"name":"sfdx","hostname":"jkenny-ltw7","pid":15128,"log":"SourcePathStatusManager","level":20,"deferContentHash":false,"sourcePath":"C:\\ValueAnalytics\\force-app\\main\\default\\waveTemplates\\ValueAnalytics\\template-info.json","size":9048,"modifiedTime":1646763999711,"changeTime":1646763999711,"contentHash":"68fb43d47d60e1238c53c6bd9e5a7f88cc31108c","state":"n","package":"force-app","metadataType":"WaveTemplateBundle","msg":"","time":"2022-03-09T14:03:37.133Z","v":0}But shortly after there's the log entry:
{"name":"sfdx","hostname":"jkenny-ltw7","pid":15128,"log":"SourcePushCommand","level":30,"msg":"[\n {\n error: 'Expected template metadata file [template-info.json] located in path [waveTemplates/ValueAnalytics/].',\n type: 'WaveTemplateBundle',\n problemType: 'Error',\n height: 1\n }\n]","time":"2022-03-09T14:03:37.316Z","v":0}Any help or advice it appreciated!
reidaelliott commentedon Mar 14, 2022
@seamusocionnaigh - any chance you could provide a simple workspace that reproduces this problem?
gmpmovies commentedon Mar 16, 2022
@seamusocionnaigh We just experienced the error again on a different machine. Moving the project to the Root folder also didn't work, but moving the project to the desktop suddenly made it work again. I really have no idea what causes this issue, but for some reason, moving the directory around to the desktop has always fixed it.
mshanemc commentedon Apr 1, 2022
closed with new commands GA