-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting --url option is mandatory error for ping and upload commands #94
Comments
Hi @mackaybeth ,
Can you try running an echo command to print the value of secrets.ARTIFACTORY_URL on runtime? |
I also experience this issue in my GitHub pipelines. But it doesn't occur always. Usually after a retry it works. If I enable JFROG_CLI_LOG_LEVEL="DEBUG" I get the following output. Run jf rt ping |
@shelling21 |
I'm curious where the race condition can take place. We use this in a pipeline that performs a hardware-in-the-loop test on a windows host which take about 3-4 minutes to complete. It looks like:
(I removed the unrelevant parts) |
@yahavi : I'm really curious what the problem can be and how to resolve it. Currently our CI/CD pipeline is unstable because of this issue and I would like to fix that. |
Hi @shelling21 and @mackaybeth, |
Hi @sverdlov93, I've updated the setup-jfrog-cli action to v3.4.2 but it does not seem to resolve the issue. The same issue happens. The problem seems to be most likely to trigger when there is a longer time between the setup-jfrog-cli action and actually using the jf command in later steps. In our use case we're downloading some binaries with the jf cli, then programming a hw target, run some tests, and then upload the test results to artifactory. Usually the failures are happening in the last upload step. It looks like some token gets expired. For now I got a workable solution to do a setup-jfrog-cli action before each time I use jf cli. Then when the token seems to get renewed when necessary. If there is already a config with a valid token it passes the action in 0s. |
Hi @shelling21 , Are you getting the same debug logs with |
@sverdlov93: I've sent you the logs via e-mail (from your GitHub profile) |
Hi @shelling21 , I see from your logs that you are using an old version of jfrog/setup-jfrog-cli. On your logs it was:
|
I'm running into this today with
putting |
@ssplatt , how do you configure the credentials for the task? here is an example:
|
Jf_url and jf_access_token as env vars |
is there a chance that your env URL is empty? can you add another step before the jfrog-cli step that prints ${{ vars.JF_URL }} to the prompt? |
We've been having the same issue recently in enterprise at the Post Download/Upload cleanup, here down some log,
JF_URL var is not empty at the Download step, but it seems it is empty an the Post job cleanup. I guess it comes from this function checkConnectionToArtifactory at the cleanup.js, but we don't understand why.
Thanks |
Hi @alexquitiaquez, thanks for reaching out! Quick question: is this issue causing the workflow to fail, or is it just displaying a warning? The JF_URL and similar environment variables are not directly used by the postJob task. Instead, it relies on the server configuration set up by the Could you share your workflow YAML file for further troubleshooting?
|
Hi @sverdlov93 ,
The annoying thing is having the same warning as many times as you use the action.
Sorry, I can't share images of my corporate environment. |
About your other questions,
In a workflow, this wrapper-jfrog-cli-action is called as follows,
Hope it's more clear now. Thanks |
Now a quick question from my side, we are using self hosted runners, so you think there is some local JFrog configuration lost between the calling step and the cleanup process at the end, right? |
Hi @alexquitiaquez, Thank you for your feedback. I understand the warnings are annoying, and they shouldn’t occur in the first place. I just wanted to clarify that these warnings are not causing the workflows to fail, which is the intended behavior. I suspect the issue may be related to the self-hosted runner. The JFrog CLI configuration is stored in the |
No, the runner is not supposed to run more than 1 workflow at a time and runners are ephemeres (destroyed after the execution) |
Hi @alexquitiaquez, I tried to reproduce this issue using a composite action in this workflow, and it worked as expected. Could something in your workflow setup be removing the JFrog configuration? Possible causes might include:
also, can you run |
Describe the bug
I'm trying to upload in a GitHub Action with
jfrog rt upload --spec build/upload_spec.json
, and I getthe --url option is mandatory
error. I tried configuring the JFrog CLI with environment variables (JF_URL and JF_TOKEN), and also with the Config Token exported from my local setup (where the command works).I tried even just running
jfrog rt ping
, and that also gives the same error.If I add --url on on the command line, the ping command works, but the upload does not (get 401 Unauthorized).
Current behavior
This is the output from the
jfrog/setup-jfrog-cli@v3
stepThis is the out put from my next step, which runs the JFrog CLI command
When I run the
jfrog rt ping
command locally with the JFROG_CLI_LOG_LEVEL="DEBUG" flag set, I see successful HTTP GET commands and 200 responses.Reproduction steps
I have this in my action:
When I run the action, the
Upload to Artifactory
step fails with the errorthe --url option is mandatory
. If I add the URL, I get 401 Unauthorized errors (which is the same thing that happens when I run thejfrog rt upload
command locally with that flag). The same thing happens if I run with the Config Token (as shown above in the snip), or with the commented outJF_URL
andJF_ACCESS_TOKEN
env vars instead. I do not try to run with all 3 env vars set.I created the admin-level access token in the Artifactory UI. We run a self-hosted installation of Artifactory, and do not use JFrog Platform.
Expected behavior
I expect to see something like this
And find my artifact in Artifactory.
Setup JFrog CLI version
@V3 (as of today, this is 3.2.0)
JFrog CLI version
I'm using the default, which is 2.35.0 as of today.
Workflow operating system type and version
linux/amd64 self-hosted runner, ubuntu-jammy-22.04
JFrog Artifactory version (if relevant)
self-hosted, 7.41.7
JFrog Xray version (if relevant)
N/A
The text was updated successfully, but these errors were encountered: