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

[BUG] Dependencies don't specify python version #988

Closed
psaiz opened this issue Dec 1, 2021 · 12 comments
Closed

[BUG] Dependencies don't specify python version #988

psaiz opened this issue Dec 1, 2021 · 12 comments
Labels
bug Something isn't working dependencies Pull requests that update a dependency file help wanted Community development is encouraged

Comments

@psaiz
Copy link

psaiz commented Dec 1, 2021

Describe the bug

There are several python scripts deployed with opensearch-dashboards, and it does not specify if they are python2 or python3

To Reproduce
Steps to reproduce the behavior:

  1. curl https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/1.2.0/opensearch-dashboards-1.2.0-linux-x64.tar.gz -o opensearch-dashboards-1.2.0-linux-x64.tar.gz
  2. tar zxf opensearch-dashboards-1.2.0-linux-x64.tar.gz
  3. head opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py -n 1
    #!/usr/bin/env python

Expected behavior
Those files should specify if it is python2 or python3

OpenSearch Version
Not needed

Dashboards Version
1.2.0

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]

Additional context
I'm running into this issue while creating an rpm of opensearch-dashboards with the content of the tar file. The full list of files suffering from this issue is:

*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/re2/vendor/re2/make_unicode_casefold.py: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/re2/vendor/re2/make_unicode_groups.py: #!/usr/bin/python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/gyp_main.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/setup.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/tools/graphviz.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/tools/pretty_sln.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/tools/pretty_vcproj.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/tools/pretty_gyp.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/test_gyp.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/__init__.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/common_test.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/input_test.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
*** ERROR: ambiguous python shebang in /usr/share/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.

For the record, I'll be happy to send the spec file that I'm using in case that helps. I followed the same procedure for opensearch, and in that one, it worked like a charm.

@psaiz psaiz added bug Something isn't working untriaged labels Dec 1, 2021
@tmarkley tmarkley added dependencies Pull requests that update a dependency file and removed untriaged labels Dec 1, 2021
@tmarkley tmarkley changed the title [BUG] [BUG] Dependencies don't specify python version Dec 1, 2021
@boktorbb
Copy link
Contributor

boktorbb commented Dec 2, 2021

Hey @psaiz, it seems to me like the issue is that your python configuration is not python 3. If you're using virtualenv, you can set the default python version to 3 and it will default to that if the script doesn't specify

@psaiz
Copy link
Author

psaiz commented Dec 7, 2021

Hi Bishoy,

Thanks for looking into this. I don't think that the issue is on the client side. Please, take a look at [1]. My understanding of this is that any file distributed should specify which version of python it requires.

Note that it could be done with the pathfix.py while creating the rpm, as mentioned on that link. At the same time, if the files in the tar file already included the proper shebangs, we wouldn't need the pathfix.py.

Cheers,
pablo

[1] https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error

@boktorbb
Copy link
Contributor

boktorbb commented Dec 7, 2021

Hey Pablo, It seems like most of these errors are coming from dependencies of Dashboards in our node_modules directory and we own very few python files in our repo. If you want to try fixing this issue and opening a PR, that would be great.

@boktorbb boktorbb added the help wanted Community development is encouraged label Dec 7, 2021
@psaiz
Copy link
Author

psaiz commented Dec 10, 2021

Hi again,

Thanks for your reply, @boktorbb-amzn. I'd be happy to help. I might need a bit more info, if you don't mind. I was looking at the Release procedures, and I'm wondering if the best place to fix this would be in this project, or in opensearch-build. I will look first into that one. If you think that's not the correct approach, please let me know.

Cheers,
pablo

@psaiz
Copy link
Author

psaiz commented Dec 15, 2021

Hi @boktorbb-amzn ,

Could you please take a look at the pull request? That should address the issue. Note that it requires one more package on the build nodes. I'm not sure where to specify that.

Best regards,
pablo

@tmarkley
Copy link
Contributor

@psaiz did you check if newer versions of re2 and node-gyp have proper shebangs in their python files?

$ npm ls node-gyp
opensearch-dashboards@2.0.0 /home/ubuntu/ws/OpenSearch-Dashboards
├─┬ @osd/optimizer@1.0.0 -> ./packages/osd-optimizer
│ └─┬ node-sass@6.0.1
│   └── node-gyp@7.1.2
└─┬ re2@1.15.4
  └── node-gyp@7.0.0

Upgrading might be a better and/or easier approach to this problem. Which OS are you using?

@psaiz
Copy link
Author

psaiz commented Dec 16, 2021

Hi Tommy,

Thanks for the remark. Indeed, node-gyp@8.0.0 fixes this issue. As far as I can see, newer versions of re2 do not help.

I'll check if increasing the version of node-gyp works, leaving the patch for the re2. I'll open a ticket on the re2 to see if they can fix the shebangs.

I'm running on Linux (CentOS).

Cheers,
pablo

@psaiz
Copy link
Author

psaiz commented Dec 16, 2021

Hi again,

I've updated the MR, requiring the version 8.2.0 of node-gyp. Higher versions of that package failed with the message:

error @npmcli/fs@1.1.0: The engine "node" is incompatible with this module. Expected version "^12.13.0 || ^14.15.0 || >=16". Got "10.24.1"

Let's see if that helps.

Cheers,
pablo

@kavilla kavilla linked a pull request Dec 17, 2021 that will close this issue
7 tasks
@tmarkley
Copy link
Contributor

tmarkley commented Jan 5, 2022

I'll open a ticket on the re2 to see if they can fix the shebangs.

It looks like you got a response on that question: uhop/node-re2#121

@psaiz
Copy link
Author

psaiz commented Jan 12, 2022

Thanks Tommy. Indeed, that one was closed, and the issue has been sent to re2 . Let's see if that one fixes it

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
…ts (opensearch-project#988)

This commit adds the support for rendering different shapes on line, area and bubble charts points
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
# [24.5.0](elastic/elastic-charts@v24.4.0...v24.5.0) (2021-01-30)

### Bug Fixes

* add theme min radius to point shape ([opensearch-project#996](elastic/elastic-charts#996)) ([98089a9](elastic/elastic-charts@98089a9))
* align tooltip z-index to EUI tooltip z-index ([opensearch-project#931](elastic/elastic-charts#931)) ([f7f1f6f](elastic/elastic-charts@f7f1f6f))
* chart state and series functions cleanup ([opensearch-project#989](elastic/elastic-charts#989)) ([42a7af0](elastic/elastic-charts@42a7af0))
* create unique ids for dot icons ([opensearch-project#971](elastic/elastic-charts#971)) ([0b3e00f](elastic/elastic-charts@0b3e00f))
* external tooltip legend extra value sync ([opensearch-project#993](elastic/elastic-charts#993)) ([7e1096e](elastic/elastic-charts@7e1096e))
* **legend:** disable focus and keyboard navigation for legend in partition ch… ([opensearch-project#952](elastic/elastic-charts#952)) ([dfff3e2](elastic/elastic-charts@dfff3e2))
* **legend:** hierarchical legend order should follow the tree paths ([opensearch-project#947](elastic/elastic-charts#947)) ([7b70186](elastic/elastic-charts@7b70186)), closes [opensearch-project#944](elastic/elastic-charts#944)
* **legend:** remove ids for circles ([opensearch-project#973](elastic/elastic-charts#973)) ([ed98481](elastic/elastic-charts@ed98481))

### Features

* **cursor:** improve theme styling for crosshair ([opensearch-project#980](elastic/elastic-charts#980)) ([0248ad6](elastic/elastic-charts@0248ad6))
* **legend:**  display pie chart legend extra ([opensearch-project#939](elastic/elastic-charts#939)) ([672a4df](elastic/elastic-charts@672a4df))
* **legend:** add keyboard navigation ([opensearch-project#880](elastic/elastic-charts#880)) ([b471a94](elastic/elastic-charts@b471a94))
* **partition:** Flame and icicle chart ([opensearch-project#965](elastic/elastic-charts#965)) ([9e8b1f7](elastic/elastic-charts@9e8b1f7))
* **partition:** legend hover options ([opensearch-project#978](elastic/elastic-charts#978)) ([acd1339](elastic/elastic-charts@acd1339))
* **xy:** support multiple point shapes on line, area and bubble charts ([opensearch-project#988](elastic/elastic-charts#988)) ([4f23b4f](elastic/elastic-charts@4f23b4f))
@psaiz
Copy link
Author

psaiz commented Mar 15, 2022

Hi again,

The dependencies have been fixed, so I think that this ticket can be closed. Thanks!

@tmarkley
Copy link
Contributor

Thanks @psaiz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file help wanted Community development is encouraged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants