mvnw: Permission denied on JHipster spring boot application - spring-boot

When I try to clone and run jHipster spring boot application using ./mvnw command, it getting an error mvnw: Permission denied. How can I solve it?

if you use dockerfile, you should add chmod +x mvnw
RUN chmod +x mvnw

Related

Laravel on ElasticBeanstalk 'log file permission denied' error keeps coming up even the permission is set in the .ebextensions config file

I am deploying my Laravel application to the ElasticBeanstalk environment. But I am having issue with laravel.log file permissions.
I deployed my application using "eb deploy" command. After I deployed, I access my application. But it is throwing the following error.
The stream or file "/var/app/current/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
To solve the issue, I ssh into the server and run the following command.
sudo -u root chmod 777 -R /var/app/current/storage/logs
The problem is solved. Now my application is working. But I deploy my application again running "be deploy" command. After the deployment, the issue popped up again. To solve the issue in a consistent way. I tried to run the command in the .ebextensions config file as follow.
container_commands:
01-migrations:
command: "php artisan migrate --force"
02-log-storage-permissions:
command: "sudo -u root chmod -R 777 /var/app/current/storage/logs/"
I could deploy my application. But the issue still persists. It seems like the command is not working. What is wrong with my configuration and how can I fix it?
I believe that this is because container_commands run when your application is in the staging folder. Thus, after you run 02-log-storage-permissions, your /var/app/current will be replaced anyway with the staging folder. So your chmod wont persist.
To rectify the issue, you can try one of the two options:
Use
02-log-storage-permissions:
command: "sudo -u chmod -R 777 ./storage/logs/"
to change the logs in staging folder.
use postdeploy hook to run your script:
after the Elastic Beanstalk platform engine deploys the application and proxy server.

JHipster GitLab CI Permission denied

I use the command "#jhipster ci-cd" to generate the file .gitlab-ci.yml for pushing on Gitlab and deploy to Heroku.
But the maven compile is failed for "./mvnw: Permission denied"
Checking out a5400e45 as master...
Skipping Git submodules setup
Checking cache for master...
FATAL: file does not exist
Failed to extract cache
$ export MAVEN_USER_HOME=`pwd`/.maven
$ ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm -DnodeVersion=v10.13.0 -DnpmVersion=6.4.1 -Dmaven.repo.local=$MAVEN_USER_HOME
/bin/bash: line 73: ./mvnw: Permission denied
ERROR: Job failed: exit code 1
i don't know why the permission is denied.
I use windows 10 for create jhipster project.
In your .gitlab-ci.yml file put:
image: openjdk:8
[ ... ]
before_script:
- chmod +x mvnw
- export MAVEN_USER_HOME=`pwd`/.maven
- ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm -DnodeVersion=v10.13.0 -DnpmVersion=6.4.1 -Dmaven.repo.local=$MAVEN_USER_HOME
- ./mvnw com.github.eirslett:frontend-maven-plugin:npm -Dmaven.repo.local=$MAVEN_USER_HOME
TL;DR;
Run the following command in you local machine under you project folder:
git update-index --chmod=+x mvnw
Make sure that the script chmod +x mvnw is removed from your .gitlab-ci.yml file.
Push the changes and then everything will works fine.
I have tried the solution mentioned in the other answer which is run chmod +x mvnw in before_script part but it does not work because the chmod is not permitted.
This problem has been dicussed in the jhipster generator github repository here. Go through the page then you'll find the solution.

Apache Maven ServiceMix not starting in mac?

When i try to run the 'maven servicemix' it throws following error.
To run i used following command:
.\bin\servicemix
Error:
jdk1.7.0_71/bin/java: cannot execute binary file
Any idea how to run maven service mix?
I found the solution by adding 'sudo' permission, run as follows in terminal.
Go inside the service mix folder:
cd /apache-servicemix-7.0.0.M1/
Provide 'sudo' permission:
sudo ./bin/servicemix
Done!

Tomcat error while running spring mvc web application on intelliJ 14

I have recently set up Spring MVC on intelliJ but whenever I run the project using Tomcat server, it gives the following error:
Error running Tomcat 8.0.171: Cannot run program
"/Library/Tomcat/bin/catalina.sh" (in directory
"/Library/Tomcat/bin"): error=13, Permission denied
The error seems to me that it has to do with permission issue.
Please help me.
Thanks in advance..
You should chmod it.
chmod a+x /Library/Tomcat/bin/catalina.sh

Laravel and AWS Elastic Beanstalk - File Permissions

I've created a Laravel app and deployed it to an EC2 instance using Elastic Beanstalk. Everything seems to work except that PHP can't write to the storage directory so I get this error:
Error in exception handler: The stream or file "/var/app/current/site/app/storage/logs/laravel.log"
could not be opened: failed to open stream:
No such file or directory in /var/app/current/site/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:84
This looks like a permissions problem to me, so I've tried using the instructions at http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html to set the permissions.
I have one file 01permissions.config in the .ebextensions directory:
commands:
storage_permissions:
command: chmod -R 755 $EB_CONFIG_APP_ONDECK/site/app/storage
I get the following errors in server logs:
[ERROR] Command storage_permissions (chmod -R 755 $EB_CONFIG_APP_ONDECK/site/app/storage) failed
[DEBUG] Command storage_permissions output: chmod: cannot access ‘/site/app/storage’: No such file or directory
Any ideas what's going on here?
The issue was that I had ignored the logs directory so it wasn't on the server at all. It's not that the server couldn't write to it, it's that it didn't exist.
The default permissions for an instance created by Elastic Beanstalk are:
File 664
Dir 775
They are deployed and owned by the Apache user.
For anyone else with this problem... this would have worked:
container_commands:
01storage_permissions:
command: "chmod -fR 755 /var/app/ondeck/app/storage"

Resources