umbraco / Umbraco.Cloud.Issues

Public issue tracker for Umbraco Cloud
26 stars 2 forks source link

Several path too long errors with standard Umbraco and Deploy files #752

Closed jemayn closed 2 months ago

jemayn commented 5 months ago

Issue description

I've noticed recently when pushing to Cloud that I get warnings when it runs the deploy in Kudu.

The errors mention a filepath too long issue, however other than the name of my project which is not that long - the files are from Umbraco and Deploy so not something I can control:

remote: ....
remote: warning: failed to remove src/Automester/obj/Release/net8.0/PubTmp/Out/wwwroot/App_Plugins/Deploy/views/components/errors/udimportartifactsunhandlederror/udimportartifactsunhandlederror.html: Filename too long
remote: hint: Setting `core.longPaths` may allow the deletion to succeed.
remote: hint: Disable this message with "git config advice.nameTooLong false"
remote: warning: failed to remove src/Automester/obj/Release/net8.0/PubTmp/Out/wwwroot/umbraco/views/propertyeditors/blockgrid/blockgridentryeditors/unsupportedblock/unsupportedblock.editor.html: Filename too long
remote: hint: Setting `core.longPaths` may allow the deletion to succeed.
remote: hint: Disable this message with "git config advice.nameTooLong false"
remote: warning: failed to remove src/Automester/obj/Release/net8.0/PubTmp/Out/wwwroot/umbraco/views/propertyeditors/blocklist/blocklistentryeditors/unsupportedblock/unsupportedblock.editor.html: Filename too long
remote: hint: Setting `core.longPaths` may allow the deletion to succeed.
remote: hint: Disable this message with "git config advice.nameTooLong false"
remote: warning: failed to remove src/Automester/obj/Release/net8.0/PubTmp/Out/wwwroot/umbraco/views/propertyeditors/rte/blocks/blockrteentryeditors/unsupportedblock/unsupportedblock.editor.html: Filename too long
remote: Removing global.json
remote: hint: Setting `core.longPaths` may allow the deletion to succeed.
remote: Failed exitCode=1, command=git clean -fdx
remote: Finished successfully.

The deployment completes and seems to work fine, but I also don't think we've edited anything within the mentioned files ever.

ksuvec commented 4 months ago

Hi @jemayn

Looks correct. It is some git setting. We will look into this

LennardF1989 commented 2 months ago

I would like to pitch in on this. Looks like you have to run git config --global core.longpaths true on the Kudu environments of Umbraco Cloud.

Particulary Umbraco v14 is causing this issue if you use Umbraco Cloud to deploy an already published package (due to CI/CD being external).

I reckon this command should be executed as part of the installed Kudu extension (eg. deploy.cmd).

It's also worth noting that this particular issue won't report an error to the Git output. It just won't log anything (contrary to when it does work, where it will run through the whole build/publish process).

mikkelhm commented 2 months ago

Theres a few things going on here - but we will try to address them - The main issue is the long paths - this might be resolved by simply setting the git configuration value - we will have to investigate if that is all it takes, we might need some settings on the app service it self as well as they are Windows boxes that could need extra stuff.

Ill just try to address the questions in the above, and try to explain what is going on.

Whenever you do a git push to a cloud environment, then we are running some scripts to make sure the files in the git repository are being moved into the right places. the final part of those scripts are running a git clean -fdx command in order to clean any files in the repository that is not part of git. We have to do this as we are running the dotnet build and dotnet publish command directly in the repository folder, and the dotnet command will generate lots of files that does not need to be in git.

Unfortunatley, its the git clean fdx command that fails, as the dotnet commands generated some paths that ends up being to long for git to handle.

The reason its not reported as an error is that the git operation (the push you initially did) was successful - that's the only thing that is being reported on - everything in the "remote" part, the scripts we run afterwards, wont be seen as error by the script, again because the git push part of the operation went fine.

For this particular issue, where its the git clean -dfx command that fails, its not the biggest issue, but just annoying, but if you were to do a deployment between two environments on Umbraco Cloud, it would be seen as a Deployment error, as we will investigate the whole process, and not just the git push part of it.

I hope that makes sense, and might bring a little clearness to what is going on - if you don't care, just erase my message from your memory ⚠️ 😂 .

TLDR; We are investigating weather the git longPaths setting is feasible in our environments :-)

mikkelhm commented 2 months ago

Ok - just a follow up on this issue.

We are releasing a new version of our deployment artifacts that will address this issue. It will simply make sure that the git core.longpaths setting is enabled when doing deployments to a cloud site. We do think its enough to remove the issue for now. Its rolling out today, so the message should be gone by tomorrow the latest.

I'm closing this issue now, but feel free to re-open it if it does not solve the issue