jenkinsci / fstrigger-plugin

https://plugins.jenkins.io/fstrigger/
10 stars 18 forks source link

FStrigger Folder monitor crashes on network file system #31

Closed Amjadhpc closed 1 year ago

Amjadhpc commented 2 years ago

Jenkins and plugins versions report

Environment ```text enkins: 2.361.1 OS: Linux - 3.10.0-1160.45.1.el7.x86_64 --- ace-editor:1.1 ant:475.vf34069fef73c antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61 bootstrap5-api:5.1.3-7 bouncycastle-api:2.26 branch-api:2.1046.v0ca_37783ecc5 build-timeout:1.21 caffeine-api:2.9.3-65.v6a_47d0f4d1fe checks-api:1.7.4 cloudbees-folder:6.740.ve4f4ffa_dea_54 command-launcher:84.v4a_97f2027398 convert-to-pipeline:1.0 credentials:1139.veb_9579fca_33b_ credentials-binding:523.vd859a_4b_122e6 display-url-api:2.3.6 durable-task:496.va67c6f9eefa7 echarts-api:5.3.3-1 email-ext:2.91 envinject-api:1.199.v3ce31253ed13 external-monitor-job:203.v683c09d993b_9 font-awesome-api:6.1.1-1 fstrigger:1.00 git:4.11.5 git-client:3.11.2 github:1.34.5 github-api:1.303-400.v35c2d8258028 github-branch-source:1677.v731f745ea_0cf gradle:1.39.4 handlebars:3.0.8 instance-identity:3.1 jackson2-api:2.13.3-285.vc03c0256d517 jakarta-activation-api:2.0.1-1 jakarta-mail-api:2.0.1-1 javadoc:226.v71211feb_e7e9 javax-activation-api:1.2.0-4 javax-mail-api:1.6.2-7 jaxb:2.3.6-1 jdk-tool:55.v1b_32b_6ca_f9ca jjwt-api:0.11.5-77.v646c772fddb_0 jquery3-api:3.6.0-4 jsch:0.1.55.61.va_e9ee26616e7 junit:1119.1121.vc43d0fc45561 ldap:2.11 mailer:435.v79ef3972b_5c7 matrix-auth:3.1.5 matrix-project:772.v494f19991984 mina-sshd-api-common:2.8.0-36.v8e25ce90d4b_1 mina-sshd-api-core:2.8.0-36.v8e25ce90d4b_1 momentjs:1.1.1 monitoring:1.91.0 okhttp-api:4.9.3-108.v0feda04578cf pam-auth:1.8 pipeline-build-step:2.18 pipeline-github-lib:38.v445716ea_edda_ pipeline-graph-analysis:195.v5812d95a_a_2f9 pipeline-groovy-lib:612.v84da_9c54906d pipeline-input-step:449.v77f0e8b_845c4 pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:2.2114.v2654ca_721309 pipeline-model-definition:2.2114.v2654ca_721309 pipeline-model-extensions:2.2114.v2654ca_721309 pipeline-rest-api:2.24 pipeline-stage-step:293.v200037eefcd5 pipeline-stage-tags-metadata:2.2114.v2654ca_721309 pipeline-stage-view:2.24 plain-credentials:139.ved2b_9cf7587b plugin-util-api:2.17.0 popper2-api:2.11.5-2 resource-disposer:0.19 scm-api:620.v0a_5b_1f8054c0 script-security:1175.v4b_d517d6db_f0 snakeyaml-api:1.30.2-76.vc104f7ce9870 ssh:2.6.1 ssh-credentials:295.vced876c18eb_4 ssh-slaves:1.834.v622da_57f702c ssh-steps:2.0.39.v831c5e6468b_c sshd:3.242.va_db_9da_b_26a_c3 structs:324.va_f5d6774f3a_d terminate-ssh-processes-plugin:1.0 timestamper:1.18 token-macro:308.v4f2b_ed62b_b_16 trilead-api:1.67.vc3938a_35172f variant:59.vf075fe829ccb windows-slaves:1.8.1 workflow-aggregator:590.v6a_d052e5a_a_b_5 workflow-api:1188.v0016b_4f29881 workflow-basic-steps:986.v6b_9c830a_6b_37 workflow-cps:2759.v87459c4eea_ca_ workflow-durable-task-step:1199.v02b_9244f8064 workflow-job:1207.ve6191ff089f8 workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:639.v6eca_cd8c04a_a_ workflow-support:838.va_3a_087b_4055b ws-cleanup:0.42 xtrigger-api:0.4 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Centos 7 . There are no agents involved.

Reproduction steps

  1. Create a Freestyle project

  2. In Configure of the project, Build Trigger section Check [FSTrigger]-Monitor Fold

  3. In the Path Text Box Enter /lustre01/...... (/lustre01 file system) . /lustre

  4. Define Schedule for monitoring (H )

  5. Write the command in Execute Shell Build steps

  6. Save

Expected Results

The script should execute every time there is a change in /lustre01/.... (folder) after polling every Hour.

Actual Results

There are two things that show

  1. I/O error Trying to monitor the folder '/lustre01/software/source/R' [ERROR] - Polling error... [ERROR] - Error message: IO error scanning directory '/lustre01/software/source/R' Jenkins Log show the following. ep 27, 2022 4:11:00 PM WARNING org.jenkinsci.plugins.xtriggerapi.AbstractTrigger reportError Polling failed IO error scanning directory '/lustre01/software/source/R' at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1191) at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1156) at org.apache.tools.ant.DirectoryScanner.checkIncludePatterns(DirectoryScanner.java:954) at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:912) at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:528) at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:489) at org.apache.tools.ant.types.DirSet.iterator(DirSet.java:73) at org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger.getFileInfo(FolderContentTrigger.java:236) at org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger.access$000(FolderContentTrigger.java:38) at org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger$1.invoke(FolderContentTrigger.java:197) at org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger$1.invoke(FolderContentTrigger.java:193) at hudson.FilePath.act(FilePath.java:1192) at hudson.FilePath.act(FilePath.java:1175) at org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger.getMd5Map(FolderContentTrigger.java:193) at org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger.checkIfModified(FolderContentTrigger.java:157) at org.jenkinsci.plugins.xtriggerapi.AbstractTrigger$Runner.run(AbstractTrigger.java:212) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

  2. It says the folder is not found even though the folder exist on the controller Polling on master.

Trying to monitor the folder '/lustre01/software/source/R' The directory '/lustre01/software/source/R' doesn't exist.

Polling complete. Took 6 ms. No changes.

Jenkins Log shows

Anything else?

/lustre is Lustre file system.https://www.lustre.org/

Jenkins is local user and is in /etc/sudoers. It can access files in /lustre01 as root.

Amjadhpc commented 2 years ago

I figured out this is a permission issue. The user was added in Lustre MDS and now can run with sudo Though would FStrigger to have option for elevated priviliges. Can close the ticket

TonyNoble commented 1 year ago

@Amjadhpc

Thanks for the update - unfortunately the trigger can only run with the permissions of the Jenkins instance itself. It would be that user running Jenkins that would need to be given elevated privileges