oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.92k stars 236 forks source link

Updated Sources Reporter throws no such file or directory #761

Closed FedorLap2006 closed 3 years ago

FedorLap2006 commented 3 years ago

Describe the bug Updated sources reporter throws no such file or directory error for a couple of files

To Reproduce Steps to reproduce the behavior:

  1. Use mega-linter@master*
  2. Run mega-linter on nektos/act
  3. See the error

P.S. Tbh, I think something wrong with my environment, but I think this still counts as bug.

Expected behavior No error/"successful info message"

Screenshots image

Additional context * @master = 1d9dbef1daf3b847abd40dbb2026b44f4cd52631

nvuillam commented 3 years ago

Is your repo public ? Or do you run Mega-Linter locally with mega-linter-runner ?

Need more info ^^

FedorLap2006 commented 3 years ago

Is your repo public ? Or do you run Mega-Linter locally with mega-linter-runner ?

Need more info ^^

Sadly, it's private codebase. Also, I'm running it on nektos/act (emulates Docker, but as I understand it runs such actions with Dockerfile, like mega-linter, in temporary containers).

About the files, they exist, unsure why the error was thrown, maybe the space, I don't know.

FedorLap2006 commented 3 years ago

I might try to use mega-lint-runner to check if issue is with nektos/act, but I have a little bit of space left and downloading 6GB, I just don't know.

nvuillam commented 3 years ago

Are you trying to install Mega-Linter to analyze https://github.com/nektos/act , or are you using nektos/act to run Mega-Linter ?

Maybe you can add LOG_LEVEL: DEBUG in your mega-linter config and share part of the logs (especially the ones with values of env variables )

FedorLap2006 commented 3 years ago

Are you trying to install Mega-Linter to analyze https://github.com/nektos/act , or are you using nektos/act to run Mega-Linter ?

Maybe you can add LOG_LEVEL: DEBUG in your mega-linter config and share part of the logs (especially the ones with values of env variables )

Second variant. Okay will try

FedorLap2006 commented 3 years ago

Well, here is my debug output.

[ci.yml/lint-go]   | All found files before filtering:
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/.dockerignore
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/.env.example
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/.github/workflows/ci.yml
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/.gitignore
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/.mega-linter.yml
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/CHANGELOG
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/LICENSE
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/Makefile
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/README.md
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/ci/event.json
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/docker-compose.test.yml
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/docker-compose.yml
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/go.mod
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/go.sum
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/auth/grpc/interceptor.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/auth/grpc/rulehandlers.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/codes/codes.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/email/regex.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/jwt/jwt.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/logging/logrus.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/details.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/status.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/status_test.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/config.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/gorm.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/tracing.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/aes.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/gateway.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/serverbs.go

...

[ci.yml/lint-go]   | Kept files before applying linter filters:
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/auth/grpc/interceptor.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/auth/grpc/rulehandlers.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/codes/codes.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/email/regex.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/jwt/jwt.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/logging/logrus.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/details.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/status.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/status_test.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/config.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/gorm.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/tracing.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/aes.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/gateway.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/serverbs.go

...

[ci.yml/lint-go]   | GO_GOLANGCI_LINT linter files after applying linter filters:
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/auth/grpc/interceptor.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/auth/grpc/rulehandlers.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/codes/codes.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/email/regex.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/jwt/jwt.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/logging/logrus.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/details.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/status.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/status/status_test.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/config.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/gorm.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/tracing/tracing.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/aes.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/gateway.go
[ci.yml/lint-go]   | - /mnt/c/WebProjects/hyperia-eps4/pkg/utils/serverbs.go

...

[ci.yml/lint-go]   | Start updated Sources Reporter
[ci.yml/lint-go]   | Popen(['git', 'diff', '--abbrev=40', '--full-index', '-M', '--raw', '-z', '--no-color'], cwd=/mnt/c/WebProjects/hyperia-eps4, universal_newlines=False, shell=None, istream=None)
[ci.yml/lint-go]   | Popen(['git', 'cat-file', '--batch-check'], cwd=/mnt/c/WebProjects/hyperia-eps4, universal_newlines=False, shell=None, istream=<valid stream>)
[ci.yml/lint-go]   | Updated files :
[ci.yml/lint-go]   | Makefile
[ci.yml/lint-go]   |  -docker-compose.yml
[ci.yml/lint-go]   |  -pkg/db/config.go
[ci.yml/lint-go]   |  -pkg/db/gorm.go
[ci.yml/lint-go]   |  -services/some/python/scripts.py # TBH, have no idea why they popped up here
[ci.yml/lint-go]   |  -services/some/python/scripts2.py
[ci.yml/lint-go]   |  -services/some/python/scripts3.py
[ci.yml/lint-go]   | Copied Makefile to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/Makefile
[ci.yml/lint-go]   | Copied docker-compose.yml to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/docker-compose.yml
[ci.yml/lint-go]   | [Updated Sources Reporter] Unable to copy pkg/db/config.go to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/pkg/db/config.go ([Errno 2] No such file or directory: 'pkg/db/config.go')
[ci.yml/lint-go]   | [Updated Sources Reporter] Unable to copy pkg/db/gorm.go to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/pkg/db/gorm.go ([Errno 2] No such file or directory: 'pkg/db/gorm.go')
[ci.yml/lint-go]   | Copied services/some/python/scripts.py to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/services/some/python/scripts.py
[ci.yml/lint-go]   | Copied services/some/python/scripts2.py to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/services/some/python/scripts2.py
[ci.yml/lint-go]   | Copied services/some/python/scripts3.py to /mnt/c/WebProjects/hyperia-eps4/report/updated_sources/services/some/python/scripts3.py
[ci.yml/lint-go]   | [Updated Sources Reporter] copied 7 fixed source files in folder /mnt/c/WebProjects/hyperia-eps4/report/updated_sources.
[ci.yml/lint-go]   | Download it from artifacts then copy-paste it in your local repo to apply linters updates
FedorLap2006 commented 3 years ago

Also, I found out that those two files had -rw-rw-r--+ permission (Windows), I changed their permission to -rwxrwxr-x+ (same as other working files). No effect

nvuillam commented 3 years ago

Are they "physical files", or maybe symlinks ?

FedorLap2006 commented 3 years ago

First one

nvuillam commented 3 years ago

Maybe you could copy your repo and remove sensitive files so I can reproduce ?

FedorLap2006 commented 3 years ago

I... think I actually got it, the problem probably was in gitignore. Don't quite remember. Anyways, thanks for the help. Probably going to close the issue, since problem is solved