generator-jhipster: Gitlab-CI found error with generated .gitlab-ci.yml

Overview of the issue

Pipeline just started, and then found FATAL: file does not exist. And don’t have any clues about the file was referred.

Motivation for or Use Case

The file is fresh generated, and then I modified a bit on chmod +x mvnw for other error I found before on Google. But it’s not related.

Reproduce the error
  • Create project
  • Run local server for first time
  • Generate .gitlab-ci.yml and push to the repository
  • Found error on log
JHipster Version(s)

5.8.2

JHipster configuration
JHipster Version(s)
my-project@0.0.0 C:\sandbox\my-project
`-- generator-jhipster@5.8.2

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
    "generator-jhipster": {
        "promptValues": {
            "packageName": "com.comp.proj",
            "nativeLanguage": "ja"
        },
        "jhipsterVersion": "5.8.2",
        "applicationType": "monolith",
        "baseName": "my-project",
        "packageName": "com.comp.proj",
        "packageFolder": "com/comp/proj,
        "serverPort": "8080",
        "authenticationType": "jwt",
        "cacheProvider": "ehcache",
        "enableHibernateCache": true,
        "websocket": false,
        "databaseType": "sql",
        "devDatabaseType": "postgresql",
        "prodDatabaseType": "postgresql",
        "searchEngine": "elasticsearch",
        "messageBroker": false,
        "serviceDiscoveryType": "eureka",
        "buildTool": "maven",
        "enableSwaggerCodegen": false,
        "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
        "clientFramework": "angularX",
        "useSass": false,
        "clientPackageManager": "npm",
        "testFrameworks": ["gatling"],
        "jhiPrefix": "jhi",
        "entitySuffix": "",
        "dtoSuffix": "DTO",
        "otherModules": [],
        "enableTranslation": true,
        "nativeLanguage": "ja",
        "languages": ["ja", "en"]
    }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

java version “1.8.0_201” Java™ SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot™ 64-Bit Server VM (build 25.201-b09, mixed mode)

git version 2.21.0.windows.1

node: v11.10.1

npm: 6.9.0

Browsers and Operating System

Windows 10 (1809 update), Chrome, but the issue might not related.

  • Checking this box is mandatory (this is just to show you read everything)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (16 by maintainers)

Most upvoted comments

I have forked and tested. It is related to permission issue. Have a detail look at log https://gitlab.com/pmverma/gitlabcibug/-/jobs/173964839 User jhipster can not execute root files.

Pasting the log if repo get deleted.

Running with gitlab-runner 11.8.0 (4745a6f3)
  on docker-auto-scale 72989761
Using Docker executor with image jhipster/jhipster:v5.8.1 ...
Pulling docker image jhipster/jhipster:v5.8.1 ...
Using docker image sha256:748c8a298c696c8ca68cb5f2fe90a64962731584685018ae96a6e41319352eef for jhipster/jhipster:v5.8.1 ...
section_start:1552023422:prepare_script
Running on runner-72989761-project-11212949-concurrent-0 via runner-72989761-srm-1552023318-3d684673...
section_end:1552023427:prepare_script
section_start:1552023427:get_sources
Cloning repository...
Cloning into '/builds/pmverma/gitlabcibug'...
Checking out daf5b80e as master...
Skipping Git submodules setup
section_end:1552023428:get_sources
section_start:1552023428:restore_cache
Checking cache for master...
FATAL: file does not exist                         
Failed to extract cache
section_end:1552023429:restore_cache
section_start:1552023429:download_artifacts
section_end:1552023431:download_artifacts
section_start:1552023431:build_script
$ whoami
jhipster
$ ls -ltr *
-rw-rw-rw-. 1 root root   2854 Mar  8 05:37 tslint.json
-rw-rw-rw-. 1 root root    742 Mar  8 05:37 tsconfig.json
-rw-rw-rw-. 1 root root    799 Mar  8 05:37 tsconfig-aot.json
-rw-rw-rw-. 1 root root    117 Mar  8 05:37 proxy.conf.json
-rw-rw-rw-. 1 root root     74 Mar  8 05:37 postcss.config.js
-rw-rw-rw-. 1 root root  55343 Mar  8 05:37 pom.xml
-rw-rw-rw-. 1 root root   5142 Mar  8 05:37 package.json
-rw-rw-rw-. 1 root root 799328 Mar  8 05:37 package-lock.json
-rw-rw-rw-. 1 root root   5810 Mar  8 05:37 mvnw.cmd
-rw-rw-rw-. 1 root root   9113 Mar  8 05:37 mvnw
-rw-rw-rw-. 1 root root    986 Mar  8 05:37 angular.json
-rw-rw-rw-. 1 root root   7059 Mar  8 05:37 README.md

webpack:
total 52
-rw-rw-rw-. 1 root root 4306 Mar  8 05:37 webpack.prod.js
-rw-rw-rw-. 1 root root 4413 Mar  8 05:37 webpack.dev.js
-rw-rw-rw-. 1 root root 3964 Mar  8 05:37 webpack.common.js
-rw-rw-rw-. 1 root root 1305 Mar  8 05:37 utils.js
-rw-rw-rw-. 1 root root 4459 Mar  8 05:37 logo-jhipster.png

src:
total 16
drwxrwxrwx. 6 root root 4096 Mar  8 05:37 test
drwxrwxrwx. 7 root root 4096 Mar  8 05:37 main
$ pwd
/builds/pmverma/gitlabcibug
$ export MAVEN_USER_HOME=`pwd`/.maven
$ ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm -DnodeVersion=v10.15.0 -DnpmVersion=6.4.1 -Dmaven.repo.local=$MAVEN_USER_HOME
/bin/bash: line 82: ./mvnw: Permission denied
section_end:1552023433:build_script
section_start:1552023433:after_script
section_end:1552023434:after_script
section_start:1552023434:upload_artifacts_on_failure
section_end:1552023436:upload_artifacts_on_failure
ERROR: Job failed: exit code 1


@pascalgrimaud should (or can) we make the generator call git update-index --chmod=+x mvnw at the end to make sure the wrapper is executable?

I see the build is running. Will check why the wrapper is not executable by default on another machine without my develop environment for jhipster.

Try git update-index --chmod=+x mvnw such that the file is marked as executable and commit & push to your git repository again.

@xenogew Can you make the wrapper files executable via windows? If you can it works just fine https://gitlab.com/atomfrede/gitlabcibug/-/jobs/173967808