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

Created on 8 Mar 2019  Â·  20Comments  Â·  Source: jhipster/generator-jhipster

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)
[email protected] C:\sandbox\my-project
`-- [email protected]

##### **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(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 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.

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

All 20 comments

@xenogew Can you create a public sample repository on Gitlab with same error produced?

@pmverma Sure, here jHipster-Gitlab-CICD-failed

And here for log jHip-n-CICD-Log

Can you try the trick with making the wrappet executable? The fatal file not found doesn't fail the build. It tries to extract the cache which of course doesn't exist for a first build yet. But I will check later too.

@atomfrede pardon, but I can't get your suggestion. Can you please describe more in specific command or method I need to do?

Does it related to JHipster cache I chose the choice, when first generated project?

No. I am talking about the gitlab ci cache. Give me a minute.

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


Exactly. The wrapper files are executable in our repository and I use gitlab ci a lot and it worked without any problems (for gradle). Has it something to do with using windows as client os (maybe it overwrites the executable flag?)

@atomfrede As you can see there is no execute permission so I doubt even root can not run ./mvnw.

You are right. Seen it too. Mh maybe something with the latest update of the ci runner infrastruture?

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

Exactly. The wrapper files are executable in our repository and I use gitlab ci a lot and it worked without any problems (for gradle). Has it something to do with using windows as client os (maybe it overwrites the executable flag?)

Sorry I am wrong! the unix maven wrapper is not marked executable in our repository Sorry my bad.

@atomfrede Apologize, but I don't get the meaning and the term of "make wrapper files executable", do you have any hint or link to let me understand?

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

@atomfrede did it, but still same
ci-cd after git update-index --chmod=+x mvnw

Sorry, forgot to tell you to remove chmod +x mvnw from the before_script of your your gitlab ci config.

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.

@atomfrede : it is not the 1st time we saw this issue. Maybe we can add some documentation at https://www.jhipster.tech/setting-up-ci/ ?

Yes will do it.

On Fri, Mar 8, 2019, 08:07 Pascal Grimaud notifications@github.com wrote:

@atomfrede https://github.com/atomfrede : it is not the 1st time we saw
this issue. Maybe we can add some documentation at
https://www.jhipster.tech/setting-up-ci/ ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/9391#issuecomment-470828678,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMaiUT8dZJanjcg_20_Aq-9ZqTLQsVVks5vUgw3gaJpZM4bkeE4
.

@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 think it's a good idea, we can try

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmedeldeeb25 picture ahmedeldeeb25  Â·  3Comments

marcelinobadin picture marcelinobadin  Â·  3Comments

pascalgrimaud picture pascalgrimaud  Â·  4Comments

SudharakaP picture SudharakaP  Â·  3Comments

trajakovic picture trajakovic  Â·  4Comments