The following error was received while trying to encrypt your password: Artifactory response: 403 Forbidden - artifactory

I am getting the below error when running the Jenkins Job but the Test connection was successful when I tested after configured in Jenkins Global configuration. Could someone please help me out on this issue?
jfrog c add artifactory-server --artifactory-url=https://test-artifactory.company.com/artifactory --user=**** --password=****
The following error was received while trying to encrypt your password:
Artifactory response: 403 Forbidden

Can you try the below syntax and check if it works? = is not required in the parameter.
Syntax:
jfrog config add <named_server_config> --artifactory-url $ARTIFACTORY_URL --user $ARTIFACTORY_USER --apikey $ARTIFACTORY_APIKEY --interactive=false
Example:
jfrog config add arti-server --artifactory-url http://IP:PORT/artifactory --user **** --password **** --interactive=false
or
jfrog c add arti-server --artifactory-url http://IP:PORT/artifactory --user **** --password **** --interactive=false

Related

Error in jfrog-cli : The following error was received while trying to encrypt your password: Artifactory response: 404 404

Error in jfrog-cli : The following error was received while trying to encrypt your password
The config command tried to encrypt your Artifactory password using an incorrect URL. Typically, it happens when the user provides JFrog platform URL as Artifactory URL and the opposite.
To fix it, you have 2 options:
Provide Artifactory URL using the --artifactory-url flag:
jfrog config add artifactory-server --artifactory-url="$ARTIFACTORY_URL" --user="$ARTIFACTORY_USER" --password="$ARTIFACTORY_PASSWORD" --interactive=false
Provide the base platform URL using --url flag:
jfrog config add artifactory-server --url="$JFROG_PLATFORM_URL" --user="$ARTIFACTORY_USER" --password="$ARTIFACTORY_PASSWORD" --interactive=false
For more information see JFrog Platform Configuration.

Ingress nginx Unable to rotate token: failed to read token file "/var/run/secrets/kubernetes.io/serviceaccount/token"

I am running nginx-ingress v0.44.0 on Kubernetes version v1.20.2, install ingress using helm chat ingress-nginx-3.23.0. nginx taking the traffic from the log file I see this error message.
E0209 23:21:41.300842 6 token_source.go:152] Unable to rotate token: failed to read token file "/var/run/secrets/kubernetes.io/serviceaccount/token": open /var/run/secrets/kubernetes.io/serviceaccount/token: permission denied
E0209 23:21:41.316286 6 token_source.go:152] Unable to rotate token: failed to read token file "/var/run/secrets/kubernetes.io/serviceaccount/token": open /var/run/secrets/kubernetes.io/serviceaccount/token: permission denied
Nignx is running uid 101 but serviceaccount directory owned by root user.
How to fix this error message?
Thanks
It's kinda odd, as I've tested I haven't experienced such a error.
You could use securityContext, set
fsGroup: 101 or
runAsUser/runAsGroup
But still the ingress-nginx sets appropriate securityContext (for example to bind on 80/443), so it should work.
As #sfgroups mentioned solution is to make nignx not running uid 101 but 0.
Add flag to installation command: --set controller.image.runAsUser=0.
Read: helm-nginx-ingress-installation.

Nginx fails to restart via Ansible

I have a task in a playbook that tries to restart nginx via a handler as per usual:
name: restart nginx
service: name=nginx state=restarted
It gaves me this following error:
RUNNING HANDLER [webtier : restart nginx] **************************************
fatal: [vagrant]: FAILED! => {"changed": false, "msg": "Unable to restart service nginx: Failed to restart nginx.service: Connection timed out\nSee system logs and 'systemctl status nginx.service' for details.\n"}
However until last time sudo: yes command was working. and the above error was not coming.
But this time, by adding sudo: yes command
name: restart nginx
service: name=nginx state=restarted
sudo: yes
Gives following error:
ERROR! conflicting action statements: service, sudo
The error appears to be in '/Users/mac/Documents/GitHub/petalandstem/ansible/roles/webtier/handlers/main.yml': line 28, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: restart nginx
^ here
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
How to restart nginx successfully ?
The correct syntax is either INI
- name: restart nginx
service: name=nginx state=restarted
become: true
become_method: sudo
or YAML
- name: restart nginx
service:
name: nginx
state: restarted
become: true
become_method: sudo
See Understanding privilege escalation: become.
Ansible 1.x: sudo: yes
Ansible 2.x: become: yes
That's because the become_method is a choice now but the default is "sudo".
--become-method=BECOME_METHOD
privilege escalation method to use (default=sudo),
valid choices: [ sudo | su | pbrun | pfexec | doas | dzdo | ksu | runas | machinectl ]
i was facing the same issue
this happened to me because httpd was already running on port 80
so i had to stop the httpd service
$ service httpd stop
then try the ansible-playbook
First don't edit the files in sites-enabled, but create links and edit in sites-available.
For me the problem was in sites-enabled folder.
When you delete the default site from sites-available folder, you need to delete the link from sites-enabled.
After deleting the default link from sites-enabled for me worked.

SFTP from Travis CI build fails with host key verification error and connection reset error

I am attempting to use after_success in a Travis CI build to deploy files to a remote server using SFTP. However, I am getting errors that prevent the upload from succeeding.
SFTP command and resulting error message:
$ sftp -b upload_sftp -i upload_key -P 2222 $sftp_user
Host key verification failed.
Couldn't read packet: Connection reset by peer
The SFTP batch file upload_sftp contains various put commands.
As the "Host key verification failed" message hints, you need to add your server's keys to the known_hosts file, as documented in the Travis CI Documentation.
Adding the following to .travis.yml uses ssh-keyscan:
addons:
ssh_known_hosts: git.example.com
Alternately, known_hosts can be appended to directly using
install:
- echo 'KEY' >> $HOME/.ssh/known_hosts

Firebase serve not working

I've been migrating to Firebase 3.0, and with the new changes, we have to use firebase serve on the CLI for local development, and I believe this defaults to port 5000. However, after going through the init process, running firebase serve doesn't do anything after "Starting Firebase development server..." even with specifying port 5000. Attempted fixes:
Tried with other ports, like 5001
Reinstalled Node (4.x and 6.x)
Reinstalled NPM
Removed firebase-cli (since firebase-tools is now being used)
Reinstalled firebase-tools with npm
Tweaked firebase init endlessly
Tried on different user accounts on my computer
Restarted computer
Checked that port 5000 was free by $lsof -i tcp:5000
Tested address variants like localhost:5000 and like 127.x and 192.x
Here is the debug log:
[debug] ----------------------------------------------------------------------
[debug] Command: /usr/local/bin/node /usr/local/bin/firebase serve -p 5000 --debug
[debug] CLI Version: 3.0.0
[debug] Platform: darwin
[debug] Node Version: v6.2.0
[debug] Time: Sun May 22 2016 01:29:59 GMT+0200 (CEST)
[debug] ----------------------------------------------------------------------
[debug]
[info] Starting Firebase development server...
[info]
[info] Project Directory: /Users/user/Documents/localdev/spfwork
Any thoughts on how to fix?
Thank you for your help.
Fixed - firebase serve from firebase-tools (npm) was missing a logger for some errors, which I added on a pull request here: https://github.com/firebase/firebase-tools/pull/143
My error was that localhost was not starting for some reason, so I changed the command to firebase serve -p 5000 -o 127.0.0.1, and specifying the listen port allowed the server to start successfully.
For reference, the error was Error: getaddrinfo ENOTFOUND localhost
You could just change your /etc/hosts file and use firebase serve normally.
To do this:
Launch Terminal
Type sudo nano /etc/hosts and press Return
Enter your admin password Paste
Paste
##
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Save the file by pressing Ctrl + O
Exit with Ctrl + X
This should fix it.
See this for more
If Firebase cannot find the 'Public' folder, this error might show up. In that case, the error can be resolved by putting index.html and other static files and app assets of the website within the public folder, and executing firebase deploy at the Firebase CLI again.

Resources