Cannot install Jenkins: no valid crumb - nginx

I've just installed Jenkins on a google cloud vm and configured nginx to point at 8080. I can enter the initial admin password and then i get to the screen where i can select plugins. When i click on "install suggested plugins" an error appears:
No valid crumb was included in this request
I started Jenkins with the command:
java -Dhudson.security.csrf.requestfield=Jenkins-Crumb -jar jenkins.war
stdout says:
INFO: Session node016ikde2z4paqem02o7wos0rgd1 already being invalidated
Nov 02, 2017 7:57:44 PM hudson.security.csrf.CrumbFilter doFilter
WARNING: Found invalid crumb 27d19a27be31d1d5703128b635b60c3b. Will
check remaining parameters for a valid one...
Nov 02, 2017 7:57:44 PM hudson.security.csrf.CrumbFilter doFilter
WARNING: No valid crumb was included in request for
/pluginManager/installPlugins. Returning 403.
does anybody know how i can either disable CSRF or include a valid crumb in my request? I can generate a valid crumb by running:
$ curl -u "admin:ebdcf2fcf6f74ee8b4ec907a1486ml?xpath=concat(//crumbRequestField,":",//crumb)'
Jenkins-Crumb:ef6250c9afe294555e20f1b9ab875261
but i don't know what to do with it after that.
Many thanks!

To Disable CSRF (although this is not recommended), follow the below 3 steps:
Log in to Jenkins as an Administrator
GOTO: Jenkins > Manage Jenkins > Configure Global Security and enable Prevent
Cross Site Request Forgery exploits
Uncheck this option
Mention the version of the Jenkins you are using to suggest on how to provide a valid crumb in your request.

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.

Forbidden when trying to register-user on axon server 4.4

After succesfully installing local axon-server-se version 4.4 I am not able to register users. I am getting 403 back from axon-server (forbidden). Users command, which should list all users on axon-server, returns empty result.
Register a user:
java -jar axonserver-cli.jar register-user -S https://AXON_SERVER:8024 -t TOKEN -u admin -p test -r ADMIN
results in
Error processing command 'register-user' on 'https://AXON_SERVER:8024/v1/users': HTTP/1.1 403 - {"timestamp":1599137927417,"status":403,"error":"Forbidden","message":"Forbidden","path":"/v1/users"}
This is a known issue for Axon and it is already fixed on 4.4.1 version, which was released yesterday!
As of version 4.4.1, you have a new properties for this case: axoniq.axonserver.accesscontrol.adminToken. This property should get the token you want to use on CLI as Admin.
If you have to stick to 4.4 though, the workaround is to create the very first admin user with access control disabled and enable it afterwards.

Openstack Keystone Authentication failure

I am new to Openstack. I installed Openstack using Packstack in my CentOS machine. When I try to login using the default keystone_admin credentials, it showed a server error.
Here is my keystone.log file. Can somebody help?
2020-05-07 03:13:57.097 2303 WARNING keystone.server.flask.application [req-8c75dc88-73f3-4605-8a6b-3ba515d9fd84 3a3280ddae08412ab1145c193b587161 - - default -] Authorization failed. The request you have made requires authentication. from 192.168.225.30: Unauthorized: The request you have made requires authentication.
2020-05-07 03:13:57.235 2300 WARNING keystone.common.rbac_enforcer.enforcer [req-d1a5e980-617f-48d4-8322-40b0aa068140 3a3280ddae08412ab1145c193b587161 - - default -] Deprecated policy rules found. Use oslopolicy-policy-generator and oslopolicy-policy-upgrade to detect and resolve deprecated policies in your configuration.
Link to picture
try to find any rc files in your /root folder.
the file name is similar with openrc or adminrc
$ .openrc
$ try some openstack command
and it will succeed.

Proxy authentication using wget on cygwin

My institute recently installed a new proxy server for our network. I am trying to configure my Cygwin environment to be able to run wget and download data from a remote repository.
Browsing the internet I have found two different solutions to my problem, but no one of them seem to work in my case.
The first one I tried was to follow these instructions, so in Cygwin:
cd /cygdrive/c/cygwin64/etc/
nano wgetrc
at the end of the file, I added:
use_proxy = on
http_proxy=http://username:password#my.proxy.ip:my.port/
https_proxy=https://username:password#my.proxy.ip:my.port/
ftp_proxy=http://username:password#my.proxy.ip:my.port/
(of course, using my user and password)
The second approach was what was suggested by this SO post, so in my Cygwin environment:
export http_proxy=http://username:password#my.proxy.ip:my.port/
export https_proxy=https://username:password#my.proxy.ip:my.port/
export ftp_proxy=http://username:password#my.proxy.ip:my.port/
in both cases, if I try to test my wget, I get the following:
$ wget http://www.google.com
--2020-01-30 12:12:22-- http://www.google.com/
Resolving my.proxy.ip (my.proxy.ip)... 10.1XX.XXX.XX
Connecting to my.proxy.ip (my.proxy.ip)|10.1XX.XXX.XX|:8XXX... connected.
Proxy request sent, awaiting response... 407 Proxy Authentication Required
2020-01-30 12:12:22 ERROR 407: Proxy Authentication Required.
It looks like if my user and password are not ok, but I actually checked them on my browsers and my credentials work just fine.
Any idea on what this could be due to?
This problem was solved thanks to the suggestion of a User of the community AskUbuntu.
Basically, instead of editing the global configuration file wgetrc, I should have created a new .wgetrc with my proxy configuration in my Cygwin home directory.
In summary:
Step 1 - Create a .wgetrc file;
nano ~/.wgetrc
Step 2 - record in this file the proxy info:
use_proxy=on
http_proxy=http://my.proxy.ip:my.port
https_proxy=https://my.proxy.ip:my.port
ftp_proxy=http://my.proxy.ip:my.port
proxy_user=username
proxy_password=password

symfony 4 NotFoundHttpException by image in public folder

creating symfony project
composer create-project symfony/skeleton cars
cd cars
php -S 127.0.0.1:8000 public/index.php
composer require annotations
composer require twig
composer require asset
Creating Page
public/image/seta.png
templates/number.html.twig
<img src="{{asset('image/seta.png')}}">
src/Controller/CarController.php
/**
* #Route("/")
*/
public function number()
{
return $this->render('number.html.twig');
}
Why does browser show:
Symfony Exception > ResourceNotFoundException > NotFoundHttpException
No route found for "GET /image/seta.png" (from "http://localhost:8000/")
(Web page doesn't show seta.png)
The issue you're having is that the browser can't find the image, as in the path you have given it doesn't exist or isn't accessible to the client. That's what your error is indicating.
You need to confirm that you can access the image through your browser first. If you can't, then I would suggest you start to look at it's location and whether the path you're using corresponds to it's location.
If you're sure the file path is fine and the image exists and that it's named correctly corresponding to what you're calling it, you should then check the file and folder permissions where the image is located so it's accessible.
Please check the HTML, this code rendered.
<img src="{{asset('image/seta.png')}}">
change
php -S 127.0.0.1:8000 public/index.php
to
php -S 127.0.0.1:8000 -t public
Ronald2g is right, you can also try with the web server bundle:
composer require server --dev
and:
php bin/console server:start
Not sure if it can help you, but this might help others having a similar issue.
I had the same issue when I was mistakenly using an internal port number (port 42595 in the example below) given in the command line feedback, instead of port 8000:
$ symfony server:start --no-tls
Feb 25 12:25:30 |DEBUG| PHP Reloading PHP versions
Feb 25 12:25:31 |DEBUG| PHP Using PHP version 7.4.2 (from default version in $PATH)
Feb 25 12:25:31 |INFO | PHP listening path="/usr/bin/php7.4" php="7.4.2" port=42595
Feb 25 12:25:31 |DEBUG| PHP started
Feb 25 12:25:31 |DEBUG| PHP PHP 7.4.2 Development Server (http://127.0.0.1:42595) started
[OK] Web server listening on 8000 http://127.0.0.1:8000 (PHP CLI 7.4.2)

Resources