"No such file or directory" building Blazor site for Pages

I used Deploy a Blazor Site to create a sample ASP.Net Core Blazor website, except I am using Eclipse and pushed using Eclipse (Egit); I assume Eclipse is not a problem. I created the build.sh. The repository is SamHobbsOrg/BlazorWasmCloudflare.

Deployment details:

The build is executing the build.sh but it gets the error:

18:46:12.220	Executing user command: ./build.sh
18:46:12.228	/opt/build/bin/build: line 39: ./build.sh: No such file or directory
18:46:12.236	Failed: build command exited with code: 127
18:46:13.062	Failed: an internal error occurred

Prior to creating that project I tried deploying a site that is working in GitHub Pages. I got a Permission Denied error at the same place for the deployment of it.

Looking at your repo, there is no build.sh file that I can see. Did you not include that file?

Thank you; I do not know what happened to it but I pushed it again and retried; it is there now, correct? I get the same output from the build; same No such file or directory from line 39.

I forked your repo and used this config to get the script to execute

That is encouraging. It does not work for me however. I still get No such file or directory.

The only difference I see is you have bash ./build.sh and I have ./build.sh for the build command. I made that change and retried the build but got the same error.

I tried creating a support ticket for this but I just get a run-around.

Can you try settings your build command to pwd && ls && bash ./build.sh and share the output you get.

Also, I fixed an in the repo and it is live at https://bc43a3ec.blazorwasmcloudflare-c9c.pages.dev/

I would recommend join the Discord Server because there are members of the workers/pages team in there.

The following is the build log.

21:52:29.625	Cloning repository...
21:52:30.450	From https://github.com/SamHobbsOrg/BlazorWasmCloudflare
21:52:30.451	 * branch            67e11befce461c8ac76a562a59f387fe6b209a0b -> FETCH_HEAD
21:52:30.451	
21:52:30.501	HEAD is now at 67e11be Project creation.
21:52:30.502	
21:52:30.637	
21:52:30.661	Success: Finished cloning repository files
21:52:31.442	Installing dependencies
21:52:31.456	Python version set to 2.7
21:52:35.431	v12.18.0 is already installed.
21:52:36.820	Now using node v12.18.0 (npm v6.14.4)
21:52:37.159	Started restoring cached build plugins
21:52:37.178	Finished restoring cached build plugins
21:52:37.889	Attempting ruby version 2.7.1, read from environment
21:52:43.834	Using ruby version 2.7.1
21:52:44.205	Using PHP version 5.6
21:52:44.384	5.2 is already installed.
21:52:44.411	Using Swift version 5.2
21:52:44.412	Installing Hugo 0.54.0
21:52:45.096	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
21:52:45.101	Started restoring cached go cache
21:52:45.124	Finished restoring cached go cache
21:52:45.282	go version go1.14.4 linux/amd64
21:52:45.303	go version go1.14.4 linux/amd64
21:52:45.307	Installing missing commands
21:52:45.308	Verify run directory
21:52:45.308	Executing user command: pwd && ls && bash ./build.sh
21:52:45.308	/opt/buildhome/repo
21:52:45.321	App.razor
21:52:45.322	BlazorWasmCloudflare.csproj
21:52:45.322	_Imports.razor
21:52:45.322	Pages
21:52:45.322	Program.cs
21:52:45.322	Properties
21:52:45.322	Shared
21:52:45.323	wwwroot
21:52:45.333	bash: ./build.sh: No such file or directory
21:52:45.339	Failed: build command exited with code: 127
21:52:46.064	Failed: an internal error occurred

Thank you for showing the site. It is encouraging; apparently Cloudflare Pages do not have the problems that GitHub Pages have. With GitHub Pages when the site has a link to an external site and we go there and try to return (go back button or whatever) we get an error (except I think GitHub Pages is now working). I messed up the external link in that sample so I cannot be sure.

I’m not too sure why it’s cloning your old repo - since build.sh doesn’t exist in this.

image

Are you retrying the old Project creation deployment or have you made a new one that has the Create build.sh commit?

Thank you. That is nearly certainly an important symptom.

I am a beginner to Git. Without getting into details, I tried undoing a commit and that seems to have caused a problem. Can you tell me what to do? Update: that might be a different project but if so then I do not understand doesn’t exist in this.

I see a build.sh in the repository.

Update: Okay, now I see that the output of ls does not show build.sh.

The below output indicates it has cloned the old commit before your Create build.sh commit.

Out of curiousity (and it being the simplest way to do it), just add a random comment into your build.sh script to cause another commit/deployment.

Like, just open it and put # test somewhere in the script (not the very first line).

I did that. Now build.sh is in there but it is complaining about Unclosed tag 'p' with no matching end tag. I fixed that and the fix is in the remote repository but I am still getting the errors.

So later on I will just re-create the repository and project.

It is now working. I do not know what the problem was.

I deleted the repository, both locally and remotely, then re-created it. I also deleted the project in Pages and re-created that. The first deployment failed but then all I did was prefix the build command with pwd && ls && bash and then it built and deployed. So perhaps the first deployment had some stuff remaining internal to Cloudflare that needed to be cleaned up but I assume that was not related to the initial problem.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.