GoogleCloudPlatform / cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more
Other
414 stars 111 forks source link

Cloud Run Service Deploy Failed with error #925

Open lalkumarrai opened 1 month ago

lalkumarrai commented 1 month ago

Environment: (Hint: "Report Extension Issue on Github" command will fill these out for you.)

Version information

Cloud Code Extension version: 2.16.0

VSCode version: 1.92

OS: window 10

Cloud SDK:

Skaffold:

Kubectl:

Description:

When I try to deploy in google cloud run The service deployment failed suddenly with the issue Failed to build the app. Error: Failed to create skaffold configuration. Error: processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}} From the logs, we can see

Running skaffold command: "C:\Users\user\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\skaffold.exe" init --artifact {"image":"gcr.io/flaskgcp-424601/scoro-optimo","builder":"Docker","payload":{"path":"Dockerfile"}} --skip-deploy --filename C:\Users\user\AppData\Local\Temp\cloud-code-cloud-run-PTBBBp\skaffold.yaml --force
processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}
Failed to build the app. Error: Failed to create skaffold configuration. Error: processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}

Before one week, it used to deploy services without any issue but suddenly its showing issues.

slde12 commented 1 month ago

Hey, can you submit feedback through extension and include the logs with it? Thanks!

Operationskcs commented 1 month ago

Did you solve this issue ? Im hving the same one. Evethying was perfect but i got the exact same error. Please let me know. thank

lalkumarrai commented 1 month ago

I am still having an issue. But found manual way to deploy services till the extension fixed.

nhat-thai commented 1 month ago

I am encountering an issue where the skaffold.yaml file is not being automatically generated. It appears that this problem is specific to Windows users. Could anyone please confirm if they are experiencing the same issue?

renzodavid9 commented 1 month ago

Hello there,

Could you please share which Skaffold version are you (the Cloud Code VS Code extension) using to deploy to Cloud Run? Thanks!

nhat-thai commented 1 month ago

Hi renzodavid9, I'm using Skaffold 2.11.1 and my Cloud Code VS Code extension version is 2.16.2 (August 2024)

Operationskcs commented 1 month ago

lalkumarrai can you please explain me how you did that manuallly please. Thanks for it bro

lalkumarrai commented 1 month ago

Hi Operationskcs, i deployed manually with below steps

chetanapsunde commented 4 weeks ago

I am encountering an issue where the skaffold.yaml file is not being automatically generated. It appears that this problem is specific to Windows users. Could anyone please confirm if they are experiencing the same issue?

Yes, I am facing same

mostafamarji commented 3 weeks ago

Getting the same error anyone figured out how to fix the problem?

ivanporty commented 3 weeks ago

We are experience an issue with AR and working on the solution with gcloud. We'll update once it's fixed

Aryido commented 3 weeks ago

Environment: (Hint: "Report Extension Issue on Github" command will fill these out for you.)

Version information

Cloud Code Extension version: 2.16.0

VSCode version: 1.92

OS: window 10

Cloud SDK:

Skaffold:

Kubectl:

Description:

When I try to deploy in google cloud run The service deployment failed suddenly with the issue Failed to build the app. Error: Failed to create skaffold configuration. Error: processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}From the logs, we can see

Running skaffold command: "C:\Users\user\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\skaffold.exe" init --artifact {"image":"gcr.io/flaskgcp-424601/scoro-optimo","builder":"Docker","payload":{"path":"Dockerfile"}} --skip-deploy --filename C:\Users\user\AppData\Local\Temp\cloud-code-cloud-run-PTBBBp\skaffold.yaml --force
processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}
Failed to build the app. Error: Failed to create skaffold configuration. Error: processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}

Before one week, it used to deploy services without any issue but suddenly its showing issues.


Hi, @lalkumarrai ,here are my findings:

Screenshot 2024-08-22 at 7 10 11 PM

But issues indeed occur on Windows. The key error is 'malformed artifact provided,' which seems to be caused by an inability to recognize the actual parameter following --artifact.

I'm not sure why the error suddenly started appearing on the Windows system. Moreover, from the following message:

malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}

it seems that the JSON keys are not enclosed in double quotes, which is quite strange.

After checking the official examples, enclosing the JSON in single quotes
can resolve the issue.

Screenshot 2024-08-22 at 7 13 08 PM

However, this leads to a further error where the skaffold.yaml is not generated. So I enclosed the Windows-path in single quotes as well.

Now based on testing and using @lalkumarrai 's example, change to this

"C:\Users\user\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\skaffold.exe" init --artifact '{"image":"gcr.io/flaskgcp-424601/scoro-optimo","builder":"Docker","payload":{"path":"Dockerfile"}}' --skip-deploy --filename 'C:\Users\user\AppData\Local\Temp\cloud-code-cloud-run-PTBBBp\skaffold.yaml' --force

Note that I added single quotes (' ') around the JSON and Windows path, then it should work successfully.

My current hypothesis is that the issue might be caused by some changes made to the command template in either the Cloud Code extension or Skaffold. Both parties may need to verify this...

LaurentiuAndrei commented 3 weeks ago

I have the same issue processing cli artifacts: malformed artifact provided: {image:fastapi-parser,builder:Docker,payload:{path:Dockerfile}}

Building the image manually and deploying using gloud commands works though.

peppySrJ commented 2 weeks ago

Still facing the same issue. Any update or ETA here? Been 3 weeks since the issue was opened and over a week since the last update was provided.

Aryido commented 2 weeks ago

Based on my local tests, I downgraded:

After these downgrades, running Cloud Run worked fine, so we can temporarily revert to this version to keep it running.

The error is likely related to the recent VSCode update.

kschaab commented 2 weeks ago

Thank you for the reproduction. We are looking at the issue for a possible fix. Unfortunately we had two issues that looked very similar, this one and one with artifact registry and missed the bug in the product.