Giter Club home page Giter Club logo

Comments (14)

mieliespoor avatar mieliespoor commented on July 27, 2024 1

Hi Ben,
I have asked one of the guys in the team to do more tests and submit more information on the support ticket. One of the projects that was sent through on the support ticket had the casing issue and fixing that solved it. In this particular instance (the project in the first post), the project name has always been lower case. We will hopefully be able to give the additional info on the support ticket tomorrow.

from cli.

lhalleyvzc avatar lhalleyvzc commented on July 27, 2024 1

Hi @benPearce1 - I combed through that command after you mentioned checking

  1. project
  2. channel
  3. space

and turns out the --channel "Release" was causing the error.

After we switched it to an existing channel it worked.

I think once you guys improve that Octopus API error: The Resource field is required. [] error - this will be easily debugged 👍

Thanks!

from cli.

benPearce1 avatar benPearce1 commented on July 27, 2024

Hi @mieliespoor

I tested the above command using v1.1 of the cli and the most recent version of Octopus Server, without issue.

There is a requirement of 2022.3 to be able to use some of functionality in the cli (these are release create, release deploy, runbook run).

from cli.

mieliespoor avatar mieliespoor commented on July 27, 2024

We are on 2022.3 build 10847. We are thus on the correct minimum version. My main problem here is that the message returned is completely useless. I tried is on my own machine in various formats and keep getting that error, so something is most definitely broken in the cli.

from cli.

benPearce1 avatar benPearce1 commented on July 27, 2024

@mieliespoor you are correct that the error message is unhelpful. I have raised an issue #221 to specifically address the unhelpful messaging in this scenario.

In the meantime, the only workaround I can suggest is to upgrade your server to 2022.3 or later.

from cli.

mieliespoor avatar mieliespoor commented on July 27, 2024

Apologies, I made a typo. We are running 2022.3.

from cli.

benPearce1 avatar benPearce1 commented on July 27, 2024

Are you able to provide me with exact server version number you are running and I will try to recreate your issue?

from cli.

mieliespoor avatar mieliespoor commented on July 27, 2024

All I can see in Octopus is 2022.3 build 10847. Not sure what other version information there is.

{
  "Id": "systeminfo-octopusserver",
  "Version": "2022.3.10847",
  "OSVersion": "Linux 4.14.301-224.520.amzn2.x86_64 #1 SMP Fri Dec 9 09:57:03 UTC 2022",
  "WorkingSetBytes": 2322493440,
  "ClrVersion": ".NET 6.0.11",
  "ThreadCount": 88,
  "Uptime": "3.04:38:26",
  "Links": {
    "Self": "/api/serverstatus/system-info"
  }
}

image

from cli.

mieliespoor avatar mieliespoor commented on July 27, 2024

Any feedback on this?

from cli.

benPearce1 avatar benPearce1 commented on July 27, 2024

Sorry for the slow response.
I haven't been able to recreate the error you are seeing, even running against the exact same server version you are using.
The artifact attached to this branch build of the cli, contains an updated cli which is an experiment on improving the debug output.
You will to update the version of octopus that you are running with the Windows exe contained in the zip file, and also need to add --debug to the command you are running. This should produce a stack trace of the failure point.

from cli.

benPearce1 avatar benPearce1 commented on July 27, 2024

@mieliespoor From the additional information provided in the support ticket you raised, it appears that it may be case-sensitivity when matching up the name of the project. This is only the case when the project query has been cached in memory, if the query has to go out to the database, it is dependant on the collation of the database.
This issue has been fixed in the most recent server versions.

Can you please try modifying your --project parameter to ensure the value exactly matches the name of the target project?

from cli.

lhalleyvzc avatar lhalleyvzc commented on July 27, 2024

Sorry for the slow response. I haven't been able to recreate the error you are seeing, even running against the exact same server version you are using. The artifact attached to this branch build of the cli, contains an updated cli which is an experiment on improving the debug output. You will to update the version of octopus that you are running with the Windows exe contained in the zip file, and also need to add --debug to the command you are running. This should produce a stack trace of the failure point.

Here is an example of a command (same one @mieliespoor gave) which results in the "Octopus API error: The Resource field is required. []" error being seen with the --debug flag added:

octopus.exe release create --project "package-update-downloader" --version "1.0.0-initial-commit.4177" --package-version "1.0.0-initial-commit.4177" --channel "Release" --release-notes "release 1.0.0-initial-commit.4177 commit -- 3c5541f4b71f9263929c7c1d241b6af05791ac05" --space "Default" --no-prompt --debug

Outputted the following:

Octopus API error: The Resource field is required. []
/home/runner/work/cli/cli/pkg/executor/release.go:75 github.com/OctopusDeploy/cli/pkg/executor.releaseCreate()
/home/runner/work/cli/cli/pkg/executor/executor.go:48 github.com/OctopusDeploy/cli/pkg/executor.ProcessTasks()
/home/runner/work/cli/cli/pkg/cmd/release/create/create.go:268 github.com/OctopusDeploy/cli/pkg/cmd/release/create.createRun()
/home/runner/work/cli/cli/pkg/cmd/release/create/create.go:156 github.com/OctopusDeploy/cli/pkg/cmd/release/create.NewCmdCreate.func1()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:916 github.com/spf13/cobra.(*Command).execute()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 github.com/spf13/cobra.(*Command).ExecuteC()
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:968 github.com/spf13/cobra.(*Command).Execute()
/home/runner/work/cli/cli/cmd/octopus/main.go:75 main.main()
/opt/hostedtoolcache/go/1.19.6/x64/src/runtime/proc.go:250 runtime.main()
/opt/hostedtoolcache/go/1.19.6/x64/src/runtime/asm_amd64.s:1594 runtime.goexit()

I can see references to /opt/hostedtoolcache - @benPearce1 perhaps a caching issue like you suggested

@mieliespoor From the additional information provided in the support ticket you raised, it appears that it may be case-sensitivity when matching up the name of the project. This is only the case when the project query has been cached in memory, if the query has to go out to the database, it is dependant on the collation of the database. This issue has been fixed in the most recent server versions.

Can you please try modifying your --project parameter to ensure the value exactly matches the name of the target project?

Here is an example of a command where we ensure the --project parameter value exactly matches the name of the target project:

octopus.exe release create --project "<REDACTED>" --version 0.0.35-develop.35.temp --package-version 0.0.35-develop.35 --package="deployment.aws.ami:12.0.154" --channel Development --release-notes "auto created from build pipeline." --space "Default" --no-prompt

Which was successful

Successfully created release version 0.0.35-develop.35.temp using channel Development

View this release on Octopus Deploy: <REDACTED>

from cli.

benPearce1 avatar benPearce1 commented on July 27, 2024

@lhalleyvzc thanks for getting back to me.

From the stack trace in the error, I can see that this is caused by an error being returned from the Octopus API. This is still suggesting that one of the resource names in the command (project, channel or space) doesn't match the casing of the resource in the server.

from cli.

mieliespoor avatar mieliespoor commented on July 27, 2024

I'm closing this since upgrading Octopus and the cli seemed to have fixed it for us. No point keeping this open anymore

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.