coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
32.59k stars 1.71k forks source link

[Bug]: [phases.setup] is using the wrong version of the .NET/dotnet 8 sdk. #2777

Open abjoseph opened 3 months ago

abjoseph commented 3 months ago

Description

As can been seen in the logs below, the [phases.setup] stage clearly specifies nixPkgs = ['dotnet-sdk_8'] the dotnet 8 sdk as the base for the build environment. However, further down, the logs shows that the outdated/old 8.0.100-preview.5.23303.2 preview version of the sdk is being used.

Coolify is a great platform and offers a lot of conveniences but it is ALSO painfully obscure and bit of a black box, can you shed some light on HOW it is resolving a nixpack version of dotnet-sdk_8 to 8.0.100-preview.5.23303.2? Especially, when I look up dotnet-sdk_8 in the search.nixos.org packages repo and it shows a .NET SDK version of 8.0.300

Where is the disconnect happening?

P.S - I also specified the NIXPACKS_CSHARP_SDK_VERSION env variable with a value of 8.0.300 and it still only uses the 8.0.100 preview version.

Minimal Reproduction (if possible, example repository)

  1. Add a new resource in your coolify instance
  2. Use the following repo as the public git source CodeAppAndInfraInDotnet8
  3. Select "Nixpacks" as your Build pack option.
  4. Set NIXPACKS_CSHARP_SDK_VERSION env variable as mentioned above to 8.0.300
  5. set build command to dotnet publish src/WeatherApi --no-restore -c Release -o out
  6. set the start command to cd out && dotnet WeatherApi.dll --urls=http://0.0.0.0:3000
  7. deploy
  8. observe the deploy fail due to syntax error because and old version 8.0.100-preview.5.23303.2 is used in the setup phase instead of the requested 8.0.300 recent sdk version.

Exception or Error

[2024-Jul-09 18:16:38.578407] Starting deployment of TechWatching/CodeAppAndInfraInDotnet8:main to Coolify-Host.
[2024-Jul-09 18:16:38.695533] Preparing container with helper image: ghcr.io/coollabsio/coolify-helper:latest.
[2024-Jul-09 18:16:38.764235]

[COMMAND] docker rm -f acsc88c
[OUTPUT]
Error response from daemon: No such container: acsc88c

[2024-Jul-09 18:16:46.727298]

[COMMAND] docker run -d --network coolify --name acsc88c --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/coollabsio/coolify-helper:latest
[OUTPUT]
3485edc041f98febb5e21982da235d9c2780da454cbb4baf0ef691091fd342ba

[2024-Jul-09 18:16:47.258073]

[COMMAND] docker exec acsc88c bash -c 'GIT_SSH_COMMAND="ssh -o ConnectTimeout=30 -p 22 -o Port=22 -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git ls-remote https://github.com/TechWatching/CodeAppAndInfraInDotnet8 main'
[OUTPUT]
8c3c35e0df862d50db61fdfb14e5c4692a04c1e4 refs/heads/main

[2024-Jul-09 18:16:47.334227] Image not found (cg0so4w:8c3c35e0df862d50db61fdfb14e5c4692a04c1e4). Building new image.
[2024-Jul-09 18:16:47.336398] ----------------------------------------
[2024-Jul-09 18:16:47.337684] Importing TechWatching/CodeAppAndInfraInDotnet8:main (commit sha HEAD) to /artifacts/acsc88c.
[2024-Jul-09 18:16:47.450034]

[COMMAND] docker exec acsc88c bash -c 'git clone -b "main" https://github.com/TechWatching/CodeAppAndInfraInDotnet8 /artifacts/acsc88c && cd /artifacts/acsc88c && sed -i "s#git@\(.*\):#https://\1/#g" /artifacts/acsc88c/.gitmodules || true && cd /artifacts/acsc88c && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git submodule update --init --recursive && cd /artifacts/acsc88c && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git lfs pull'
[OUTPUT]
Cloning into '/artifacts/acsc88c'...

[2024-Jul-09 18:16:47.599425]

[COMMAND] docker exec acsc88c bash -c 'git clone -b "main" https://github.com/TechWatching/CodeAppAndInfraInDotnet8 /artifacts/acsc88c && cd /artifacts/acsc88c && sed -i "s#git@\(.*\):#https://\1/#g" /artifacts/acsc88c/.gitmodules || true && cd /artifacts/acsc88c && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git submodule update --init --recursive && cd /artifacts/acsc88c && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git lfs pull'
[OUTPUT]
sed: /artifacts/acsc88c/.gitmodules: No such file or directory

[2024-Jul-09 18:16:47.904606]

[COMMAND] docker exec acsc88c bash -c 'cd /artifacts/acsc88c && git log -1 8c3c35e0df862d50db61fdfb14e5c4692a04c1e4 --pretty=%B'
[OUTPUT]
Add the infrastructure code

[2024-Jul-09 18:16:48.028291] Generating nixpacks configuration with: nixpacks plan -f toml --env NIXPACKS_CSHARP_SDK_VERSION=8.0.300 --build-cmd "dotnet publish src/WeatherApi --no-restore -c Release -o out" --start-cmd "cd out && dotnet WeatherApi.dll --urls=[http://0.0.0.0:3000"](http://0.0.0.0:3000/) /artifacts/acsc88c
[2024-Jul-09 18:16:48.162907]

[COMMAND] docker exec acsc88c bash -c 'nixpacks plan -f toml --env NIXPACKS_CSHARP_SDK_VERSION=8.0.300 --build-cmd "dotnet publish src/WeatherApi --no-restore -c Release -o out" --start-cmd "cd out && dotnet WeatherApi.dll --urls=http://0.0.0.0:3000" /artifacts/acsc88c'
[OUTPUT]
providers = []
buildImage = 'ghcr.io/railwayapp/nixpacks:ubuntu-1716249803'

[variables]
ASPNETCORE_ENVIRONMENT = 'Production'
ASPNETCORE_URLS = 'http://0.0.0.0:3000'/
DOTNET_ROOT = '/nix/var/nix/profiles/default/'
NIXPACKS_CSHARP_SDK_VERSION = '8.0.300'
NIXPACKS_METADATA = 'c#'
[phases.build]
dependsOn = ['install']
cmds = ['dotnet publish src/WeatherApi --no-restore -c Release -o out']

[phases.install]
dependsOn = ['setup']
cmds = ['dotnet restore']

[phases.setup]
nixPkgs = ['dotnet-sdk_8']
nixOverlays = []
nixpkgsArchive = '5148520bfab61f99fd25fb9ff7bfbb50dad3c9db'

[start]
cmd = 'cd out && dotnet WeatherApi.dll --urls=http://0.0.0.0:3000'/
[2024-Jul-09 18:16:48.290593]

[COMMAND] docker exec acsc88c bash -c 'nixpacks detect /artifacts/acsc88c'
[OUTPUT]
c#

[2024-Jul-09 18:16:48.296143] Found application type: c#.
[2024-Jul-09 18:16:48.297863] If you need further customization, please check the documentation of Nixpacks: https://nixpacks.com/docs/providers/c#
[2024-Jul-09 18:16:48.302746]

[COMMAND]
[OUTPUT]
Final Nixpacks plan: {
"providers": [],
"buildImage": "ghcr.io\/railwayapp\/nixpacks:ubuntu-1716249803",
"variables": {
"SOURCE_COMMIT": "8c3c35e0df862d50db61fdfb14e5c4692a04c1e4",
"ASPNETCORE_ENVIRONMENT": "Production",
"ASPNETCORE_URLS": "http:\/\/0.0.0.0:3000",
"DOTNET_ROOT": "\/nix\/var\/nix\/profiles\/default\/",
"NIXPACKS_CSHARP_SDK_VERSION": "8.0.300",
"NIXPACKS_METADATA": "c#"
},
"phases": {
"build": {
"dependsOn": [
"install"
],
"cmds": [
"dotnet publish src\/WeatherApi --no-restore -c Release -o out"
]
},
"install": {
"dependsOn": [
"setup"
],
"cmds": [
"dotnet restore"
]
},
"setup": {
"nixPkgs": [
"dotnet-sdk_8"
],
"nixOverlays": [],
"nixpkgsArchive": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db",
"aptPkgs": [
"curl",
"wget"
]
}
},
"start": {
"cmd": "cd out && dotnet WeatherApi.dll --urls=http:\/\/0.0.0.0:3000"
}
}

[2024-Jul-09 18:16:48.772129] ----------------------------------------
[2024-Jul-09 18:16:48.774203] Building docker image started.
[2024-Jul-09 18:16:48.775693] To check the current progress, click on Show Debug Logs.
[2024-Jul-09 18:16:49.024441]

[COMMAND] docker exec acsc88c bash -c 'nixpacks build -c /artifacts/thegameplan.json --cache-key 'cg0so4w' --no-error-without-start -n cg0so4w:8c3c35e0df862d50db61fdfb14e5c4692a04c1e4 /artifacts/acsc88c -o /artifacts/acsc88c'
[OUTPUT]

╔═════════════════════════════ Nixpacks v1.24.1 ════════════════════════════╗
║ setup │ dotnet-sdk_8, curl, wget ║
║───────────────────────────────────────────────────────────────────────────║
║ install │ dotnet restore ║
║───────────────────────────────────────────────────────────────────────────║
║ build │ dotnet publish src/WeatherApi --no-restore -c Release -o out ║
║───────────────────────────────────────────────────────────────────────────║
║ start │ cd out && dotnet WeatherApi.dll --urls=http://0.0.0.0:3000/ ║
╚═══════════════════════════════════════════════════════════════════════════╝

Saved output to:
/artifacts/acsc88c
[2024-Jul-09 18:16:49.663588]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.07kB done
#1 DONE 0.0s

[2024-Jul-09 18:16:49.666715]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1716249803

[2024-Jul-09 18:16:49.725369]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#2 DONE 0.2s

[2024-Jul-09 18:16:49.904761]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [ 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1716249803@sha256:5ef4d2021c418fcaabb56cea5ea9e24a5fdedfe27f58062d9689214dfed45c46
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 35.78kB done
#5 DONE 0.0s

#6 [ 2/10] WORKDIR /app/
#6 CACHED

#7 [ 3/10] COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix
#7 CACHED

#8 [ 4/10] RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d
#8 CACHED

#9 [ 5/10] RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends curl wget
#9 CACHED

#10 [ 6/10] COPY . /app/.

[2024-Jul-09 18:16:51.849451]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#10 DONE 2.1s

[2024-Jul-09 18:16:52.002378]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 [ 7/10] RUN dotnet restore

[2024-Jul-09 18:16:52.026735]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 0.175

[2024-Jul-09 18:16:52.180726]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 0.178 Welcome to .NET 8.0!
#11 0.178 ---------------------
#11 0.178 SDK Version: 8.0.100-preview.5.23303.2
#11 0.178
#11 0.178 Telemetry
#11 0.178 ---------
#11 0.178 The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
#11 0.178
#11 0.178 Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
#11 0.178
#11 0.178 ----------------
#11 0.178 Installed an ASP.NET Core HTTPS development certificate.
#11 0.178 To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
#11 0.178 Learn about HTTPS: https://aka.ms/dotnet-https
#11 0.178 ----------------
#11 0.178 Write your first app: https://aka.ms/dotnet-hello-world
#11 0.178 Find out what's new: https://aka.ms/dotnet-whats-new
#11 0.178 Explore documentation: https://aka.ms/dotnet-docs
#11 0.178 Report issues and find source on GitHub: https://github.com/dotnet/core
#11 0.178 Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
#11 0.178 --------------------------------------------------------------------------------------
[2024-Jul-09 18:16:52.868652]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 1.017 Determining projects to restore...

[2024-Jul-09 18:16:55.535337]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 3.683 Restored /app/src/WeatherApi/WeatherApi.csproj (in 2.38 sec).

[2024-Jul-09 18:16:56.301440]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 4.450 Restored /app/infra/AzureManagementLibraries/AzureManagementSdk.csproj (in 3.16 sec).

[2024-Jul-09 18:17:00.158580]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 8.307 Restored /app/infra/WeatherApi.Infra/WeatherApi.Infra.csproj (in 4.11 sec).

[2024-Jul-09 18:17:05.167576]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#11 DONE 13.3s

[2024-Jul-09 18:17:05.360599]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#12 [ 8/10] COPY . /app/.
#12 DONE 0.0s

#13 [ 9/10] RUN dotnet publish src/WeatherApi --no-restore -c Release -o out

[2024-Jul-09 18:17:05.439604]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#13 0.229 MSBuild version 17.7.0-preview-23281-03+4ce2ff1f8 for .NET

[2024-Jul-09 18:17:05.882773]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#13 0.672 /nix/store/r6yspcqpmvjdyvysj5rj7w40xm93g869-dotnet-sdk-8.0.100-preview.5.23303.2/sdk/8.0.100-preview.5.23303.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/app/src/WeatherApi/WeatherApi.csproj]
[2024-Jul-09 18:17:06.777765]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#13 1.567 /app/src/WeatherApi/Services/RandomWeatherService.cs(5,60): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]

[2024-Jul-09 18:17:06.929907]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#13 1.569 /app/src/WeatherApi/Services/RandomWeatherService.cs(6,50): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]

[2024-Jul-09 18:17:11.308880]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
#13 ERROR: process "/bin/bash -ol pipefail -c dotnet publish src/WeatherApi --no-restore -c Release -o out" did not complete successfully: exit code: 1

[2024-Jul-09 18:17:11.322164]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
------
> [ 9/10] RUN dotnet publish src/WeatherApi --no-restore -c Release -o out:
0.229 MSBuild version 17.7.0-preview-23281-03+4ce2ff1f8 for .NET
0.672 /nix/store/r6yspcqpmvjdyvysj5rj7w40xm93g869-dotnet-sdk-8.0.100-preview.5.23303.2/sdk/8.0.100-preview.5.23303.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/app/src/WeatherApi/WeatherApi.csproj]
1.567 /app/src/WeatherApi/Services/RandomWeatherService.cs(5,60): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]
1.569 /app/src/WeatherApi/Services/RandomWeatherService.cs(6,50): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]
------
[2024-Jul-09 18:17:11.324823]

[COMMAND] docker exec acsc88c bash -c 'bash /artifacts/build.sh'
[OUTPUT]
Dockerfile:23
--------------------
21 | # build phase
22 | COPY . /app/.
23 | >>> RUN dotnet publish src/WeatherApi --no-restore -c Release -o out
24 |
25 |
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c dotnet publish src/WeatherApi --no-restore -c Release -o out" did not complete successfully: exit code: 1

[2024-Jul-09 18:17:11.358862] Oops something is not okay, are you okay? 😢

[2024-Jul-09 18:17:11.360664] #0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.07kB done
#1 DONE 0.0s

#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1716249803
#2 DONE 0.2s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [ 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1716249803@sha256:5ef4d2021c418fcaabb56cea5ea9e24a5fdedfe27f58062d9689214dfed45c46
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 35.78kB done
#5 DONE 0.0s

#6 [ 2/10] WORKDIR /app/
#6 CACHED

#7 [ 3/10] COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix
#7 CACHED

#8 [ 4/10] RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d
#8 CACHED

#9 [ 5/10] RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends curl wget
#9 CACHED

#10 [ 6/10] COPY . /app/.
#10 DONE 2.1s

#11 [ 7/10] RUN dotnet restore
#11 0.175
#11 0.178 Welcome to .NET 8.0!
#11 0.178 ---------------------
#11 0.178 SDK Version: 8.0.100-preview.5.23303.2
#11 0.178
#11 0.178 Telemetry
#11 0.178 ---------
#11 0.178 The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
#11 0.178
#11 0.178 Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
#11 0.178
#11 0.178 ----------------
#11 0.178 Installed an ASP.NET Core HTTPS development certificate.
#11 0.178 To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
#11 0.178 Learn about HTTPS: https://aka.ms/dotnet-https
#11 0.178 ----------------
#11 0.178 Write your first app: https://aka.ms/dotnet-hello-world
#11 0.178 Find out what's new: https://aka.ms/dotnet-whats-new
#11 0.178 Explore documentation: https://aka.ms/dotnet-docs
#11 0.178 Report issues and find source on GitHub: https://github.com/dotnet/core
#11 0.178 Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
#11 0.178 --------------------------------------------------------------------------------------
#11 1.017 Determining projects to restore...
#11 3.683 Restored /app/src/WeatherApi/WeatherApi.csproj (in 2.38 sec).
#11 4.450 Restored /app/infra/AzureManagementLibraries/AzureManagementSdk.csproj (in 3.16 sec).
#11 8.307 Restored /app/infra/WeatherApi.Infra/WeatherApi.Infra.csproj (in 4.11 sec).
#11 DONE 13.3s

#12 [ 8/10] COPY . /app/.
#12 DONE 0.0s

#13 [ 9/10] RUN dotnet publish src/WeatherApi --no-restore -c Release -o out
#13 0.229 MSBuild version 17.7.0-preview-23281-03+4ce2ff1f8 for .NET
#13 0.672 /nix/store/r6yspcqpmvjdyvysj5rj7w40xm93g869-dotnet-sdk-8.0.100-preview.5.23303.2/sdk/8.0.100-preview.5.23303.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/app/src/WeatherApi/WeatherApi.csproj]
#13 1.567 /app/src/WeatherApi/Services/RandomWeatherService.cs(5,60): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]
#13 1.569 /app/src/WeatherApi/Services/RandomWeatherService.cs(6,50): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]
#13 ERROR: process "/bin/bash -ol pipefail -c dotnet publish src/WeatherApi --no-restore -c Release -o out" did not complete successfully: exit code: 1
------
> [ 9/10] RUN dotnet publish src/WeatherApi --no-restore -c Release -o out:
0.229 MSBuild version 17.7.0-preview-23281-03+4ce2ff1f8 for .NET
0.672 /nix/store/r6yspcqpmvjdyvysj5rj7w40xm93g869-dotnet-sdk-8.0.100-preview.5.23303.2/sdk/8.0.100-preview.5.23303.2/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/app/src/WeatherApi/WeatherApi.csproj]
1.567 /app/src/WeatherApi/Services/RandomWeatherService.cs(5,60): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]
1.569 /app/src/WeatherApi/Services/RandomWeatherService.cs(6,50): error CS1525: Invalid expression term '[' [/app/src/WeatherApi/WeatherApi.csproj]
------
Dockerfile:23
--------------------
21 | # build phase
22 | COPY . /app/.
23 | >>> RUN dotnet publish src/WeatherApi --no-restore -c Release -o out
24 |
25 |
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c dotnet publish src/WeatherApi --no-restore -c Release -o out" did not complete successfully: exit code: 1
[2024-Jul-09 18:17:11.362773] Deployment failed. Removing the new version of your application.

Version

v4.0.0-beta.306

FrSenpai commented 1 month ago

Same here... any solution ?

renerlemes commented 1 month ago

I have the same problemn!

AlgorithmCorner commented 1 month ago

I am having exactly the same problem. Tried multiple things to make it work but I always got same error in publish phase.

EDIT: After struggling with this for over a day, I decided to create a docker file and publish using it.