Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6.20.0] Console Reporter broken for PHP flavour #2425

Closed
llaville opened this issue Mar 6, 2023 · 21 comments
Closed

[v6.20.0] Console Reporter broken for PHP flavour #2425

llaville opened this issue Mar 6, 2023 · 21 comments
Labels
bug Something isn't working O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity

Comments

@llaville
Copy link
Collaborator

llaville commented Mar 6, 2023

Describe the bug
The summary table is not completed after an analysis.

To Reproduce

  1. Download latest image of PHP flavour with docker pull oxsecurity/megalinter-php:v6 (digest: sha256:b38beb2a78234c3719a473b318b9e67651f56423c9a0faf979a1a2c8c2b035d3)
  2. Run following command sudo rm -rf megalinter-reports/ && time docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/tmp/lint:rw oxsecurity/megalinter-php:v6 on a local git clone of my repository https://github.com/llaville/php-compatinfo-db (master branch)
  3. See error

Expected behavior
As previous version a summary table complete.

Screenshots

megalinter-620

Additional context
Local platform : Ubuntu 22.04 LTS on WSL2

@llaville llaville added the bug Something isn't working label Mar 6, 2023
@llaville
Copy link
Collaborator Author

llaville commented Mar 6, 2023

Here are results I got with previous version

----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2023-02-05T11:58:18Z
 - Image Revision: f8d535e
 - Image Version: v6
----------------------------------------------------------------------------------------------------

Docker image has disgest sha256:2744b2f1d9e919e13d1190dfaaa95bee93d22d6828bd0e7449396ad7c555a1cc

megalinter-6

BTW v6.20.0 has header version identification changed. Now I got

----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 
 - Image Revision: 0d699a348a2c104040efd78f2d2970e6ae8e5769
 - Image Version: 0d699a348a2c104040efd78f2d2970e6ae8e5769
----------------------------------------------------------------------------------------------------

Compare to previous version !

@llaville
Copy link
Collaborator Author

llaville commented Mar 6, 2023

And summary table crash gave me other results each time I run it. Sometimes it break results after, sometimes I got this error

+----SUMMARY------+----------------------+---------------+-------+-------+--------+--------------+
| Descriptor      | Linter               | Mode          | Files | Fixed | Errors | Elapsed time |
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/multiprocessing_logging-0.3.4-py3.11.egg/multiprocessing_logging.py", line 77, in _receive
    record = self.queue.get(timeout=0.2)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/queues.py", line 117, in get
    res = self._recv_bytes()
          ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 215, in recv_bytes
    buf = self._recv_bytes(maxlength)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 420, in _recv_bytes
    return self._recv(size)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 378, in _recv
    chunk = read(handle, remaining)
            ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer
Exception in thread mp-handler-0:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/site-packages/multiprocessing_logging-0.3.4-py3.11.egg/multiprocessing_logging.py", line 77, in _receive
    record = self.queue.get(timeout=0.2)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/queues.py", line 117, in get
    res = self._recv_bytes()
          ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 215, in recv_bytes
    buf = self._recv_bytes(maxlength)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 420, in _recv_bytes
    return self._recv(size)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 378, in _recv
    chunk = read(handle, remaining)
            ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer

real    0m31.776s
user    0m0.096s
sys     0m0.132s

@Kurt-von-Laven
Copy link
Collaborator

This may be related to #2348. Which OS are you on, and are you using rootless or rootful Docker?

@llaville
Copy link
Collaborator Author

llaville commented Mar 6, 2023

@Kurt-von-Laven No it seems to come from parallelization ! I've just tried to disable it with PARALLEL: false in my megalinter config file, and I got results

megalinter-620-no-parallel

@Kurt-von-Laven
Copy link
Collaborator

That's great to hear. Actually the answer to my previous question may still be relevant to #2348.

@llaville
Copy link
Collaborator Author

llaville commented Mar 6, 2023

I confim, each time I run with PARALLEL directive enabled, the console reporter crash.
Now I'll disable it by default to avoid issue with GitHub Workflow, and enable it locally :

sudo rm -rf megalinter-reports/ && time docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:rw -v $(pwd):/tmp/lint:rw -e PARALLEL=true oxsecurity/megalinter-php:v6

Reminder for me : llaville/php-compatinfo-db@90dfb29

@Kurt-von-Laven
Copy link
Collaborator

Makes sense. I meant this question though:

Which OS are you on, and are you using rootless or rootful Docker?

@llaville
Copy link
Collaborator Author

llaville commented Mar 6, 2023

Rootfull Docker (default) on Ubuntu 20.04.2 LTS WSL2

@Kurt-von-Laven
Copy link
Collaborator

Thank you! That helps confirm our theory that the v6.20.0 images can only be pulled using rootful Docker.

@nvuillam
Copy link
Member

nvuillam commented Mar 6, 2023

Grmblmblm I hope it's not related to multiprocessing-logging

@llaville
Copy link
Collaborator Author

llaville commented Mar 8, 2023

FYI: I've just tested version 6.20.1, and this issue still exists !

But the creation date in header was fixed (thanks)

----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2023-03-07T19:35:10Z
 - Image Revision: 7411316caa2897b3839af1834e5fd8ebd5b7b81e
 - Image Version: 7411316caa2897b3839af1834e5fd8ebd5b7b81e
----------------------------------------------------------------------------------------------------

But, bad new, I've noticed that links to https://megalinter.io/**/descriptors/** were broken (404)

This is a chunk of report produced, but all links are affected !

broken_links-megalinter-6201

@llaville
Copy link
Collaborator Author

llaville commented Mar 8, 2023

Just to compare with previous release that did not have this issue

----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2023-02-05T11:58:18Z
 - Image Revision: f8d535e
 - Image Version: v6
----------------------------------------------------------------------------------------------------

And all link to megalinter.io descriptors were not broken (usage of latest compare to hash version used in 6.20.1)

v6 19

@llaville
Copy link
Collaborator Author

llaville commented Mar 8, 2023

One possible reason, is that the latest release did not point to v6.20.1 (unavailable on https://megalinter.io)

megalinter_io

@nvuillam
Copy link
Member

nvuillam commented Mar 9, 2023

@llaville the latest release is always behind "latest", and becomes available in the list once there is a new release :)

It's because of the messy doc version management with mike

@llaville
Copy link
Collaborator Author

After a long period to retrieve full flavor docker image

Digest: sha256:fb88bc1c8af10fd31443789ba7390008bf257e1e32eb9da540495eb89a0cb9f8
Status: Downloaded newer image for oxsecurity/megalinter:v6
docker.io/oxsecurity/megalinter:v6

real    55m27.963s
user    0m1.304s
sys     0m1.784s

This issue affect all MegaLinter v6.20.1 versions (and not only the PHP flavor)

I can confirm @nvuillam your intuition (3 days ago !!!)

@nvuillam
Copy link
Member

@llaville on what do you run MegaLinter ?
Parallel stuff seems to work verywhere , else we would have been flooded by issues... do you have a specific hardcore local config ? :(

@nvuillam
Copy link
Member

If it is multiprocessing-logging, the maintainer took 4 months to accept the PR that fixed the bug, I was close to make a hard-fork :'(

@llaville
Copy link
Collaborator Author

@nvuillam
Copy link
Member

@llaville if it was the case everywhere we wouldn't have any MegaLinter 6.20.x working :/

I posted an issue on the repo, maybe they can help :/

Meanwhile, you can remain with the PARALLEL: false workaround, but I understand that's is not good for perfs, especially if you run on an engine with more than 2 cores :/

@Kurt-von-Laven
Copy link
Collaborator

I just had a non-deterministic encounter with the same stack trace as @llaville while running the v6.20.1 JavaScript flavor on ScribeMD/docker-cache. The first time it showed up was also the first time I got ESLint running (although very badly since we're using Yarn, so it can't find any tsconfig.json installed via Yarn). That makes me worry that landing #2455 will exacerbate this bug for our JavaScript users who are using mega-linter-runner.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Apr 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity
Projects
None yet
Development

No branches or pull requests

3 participants