fundacaocerti / mobsf-action

GitHub Actions for MobSF
GNU General Public License v3.0
25 stars 23 forks source link

Issue generating pdf #9

Open codewithtushar opened 3 years ago

codewithtushar commented 3 years ago

Hi,

getting error generating and uploading pdf , below is error and few lines from the log

   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0[INFO] 13/Apr/2021 14:09:37 - 
API Key read from environment variable
[INFO] 13/Apr/2021 14:09:37 - Fetching data from DB for PDF Report Generation (Android)
[INFO] 13/Apr/2021 14:09:37 - Analysis is already Done. Fetching data from the DB...
[INFO] 13/Apr/2021 14:09:38 - Generating PDF report for android apk

100  738k    0  738k  100    37  1133k     56 --:--:-- --:--:-- --:--:-- 1133k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0[INFO] 13/Apr/2021 14:09:38 - 
API Key read from environment variable
[INFO] 13/Apr/2021 14:09:38 - Fetching data from DB for PDF Report Generation (Android)
[INFO] 13/Apr/2021 14:09:38 - Analysis is already Done. Fetching data from the DB...
[/api/v1/report_json] Generate the json report
[/api/v1/report_json] JSON report generated
[/api/v1/download_pdf] Generate the PDF report

100    37    0     0  100    37      0    180 --:--:-- --:--:-- --:--:--   179[INFO] 13/Apr/2021 14:09:38 - Generating PDF report for android apk

100    37    0     0  100    37      0     30  0:00:01  0:00:01 --:--:--    30
100    37    0     0  100    37      0     16  0:00:02  0:00:02 --:--:--    16
100 83644    0 83607  100    37  32094     14  0:00:02  0:00:02 --:--:-- 32096
[/api/v1/download_pdf] PDF report generated
[/api/v1/delete_scan] Remove analysis from MobSF server
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0[INFO] 13/Apr/2021 14:09:41 - 
API Key read from environment variable

Error occurred while creating file for class Lcom/google/zxing/common/detector/MathUtils;
java.io.IOException: No such file or directory
    at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.base/java.io.File.createNewFile(File.java:1024)
    at org.jf.util.ClassFileNameHandler$FileEntry.createIfNeeded(ClassFileNameHandler.java:438)
    at org.jf.util.ClassFileNameHandler$FileSystemEntry.setSuffix(ClassFileNameHandler.java:290)
    at org.jf.util.ClassFileNameHandler$DirectoryEntry.addChild(ClassFileNameHandler.java:347)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:140)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.getUniqueFilenameForClass(ClassFileNameHandler.java:132)
    at org.jf.baksmali.Baksmali.disassembleClass(Baksmali.java:123)
    at org.jf.baksmali.Baksmali.access$000(Baksmali.java:46)
    at org.jf.baksmali.Baksmali$1.call(Baksmali.java:76)
    at org.jf.baksmali.Baksmali$1.call(Baksmali.java:74)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    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:835)

Error occurred while creating file for class Lcom/google/zxing/common/detector/WhiteRectangleDetector;
java.io.IOException: No such file or directory
    at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.base/java.io.File.createNewFile(File.java:1024)
    at org.jf.util.ClassFileNameHandler$FileEntry.createIfNeeded(ClassFileNameHandler.java:438)
    at org.jf.util.ClassFileNameHandler$FileSystemEntry.setSuffix(ClassFileNameHandler.java:290)
    at org.jf.util.ClassFileNameHandler$DirectoryEntry.addChild(ClassFileNameHandler.java:347)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:140)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.addUniqueChild(ClassFileNameHandler.java:151)
    at org.jf.util.ClassFileNameHandler.getUniqueFilenameForClass(ClassFileNameHandler.java:132)
    at org.jf.baksmali.Baksmali.disassembleClass(Baksmali.java:123)
    at org.jf.baksmali.Baksmali.access$000(Baksmali.java:46)
    at org.jf.baksmali.Baksmali$1.call(Baksmali.java:76)
    at org.jf.baksmali.Baksmali$1.call(Baksmali.java:74)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    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:835)
[ERROR] 13/Apr/2021 14:09:41 - [Errno 39] Directory not empty: 'zxing'
[ERROR] 13/Apr/2021 14:09:41 - Internal Server Error: /api/v1/delete_scan

{"error": "[Errno 39] Directory not empty: 'zxing'"}[/api/v1/delete_scan] Analysis removed
100    89    0    52  100    37    154    109 --:--:-- --:--:-- --:--:--   264

I am using below steps


      - name: Run  MobSF Analysis scanning 
        uses: inm-certi/mobsf-action@v1.5
        env:
          INPUT_FILE_NAME: platforms/android/app/build/outputs/apk/release/app-release-unsigned-signed.apk
          SCAN_TYPE: apk
          OUTPUT_FILE_NAME: mobsf-report

      - name: Upload MobSF Analysis Result
        uses: actions/upload-artifact@v2
        with:
          name: mobsf-report.pdf
          path: reports/mobsf-report.pdf

      - name: Upload MobSF Analysis JSON Result
        uses: actions/upload-artifact@v2
        with:
          name: mobsf-report.json
          path: reports/mobsf-report.json

Looks like remove analysis didn't worked, but reports were not uploaded

image