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

google-cloud-sdk-222.0.0: "The signurl command requires the pyopenssl library" #67094

Closed
toraritte opened this issue Aug 20, 2019 · 5 comments
Closed
Assignees
Labels
0.kind: bug Something is broken
Milestone

Comments

@toraritte
Copy link
Contributor

Describe the bug
Getting the error when trying to generate a signed URL:

$ gsutil signurl -d 10m service_account.json gs://bucket/file

CommandException: The signurl command requires the pyopenssl library (try pip install pyopenssl or easy_install pyopenssl)

It is more than possible that I am doing something wrong because I can see pyopenssl as a dependency in the package's default.nix, and in the output when installing the package:

$ nix-env -iA nixos.google-cloud-sdk

installing 'google-cloud-sdk-222.0.0'
these paths will be fetched (26.14 MiB download, 185.08 MiB unpacked):
  /nix/store/26ani5lvmf4yanr8m7jc1z3irdk16yqg-gdbm-1.18.1
  /nix/store/4wkmn4v3ah06wkincrpqqqwwnvg8fdxd-readline-6.3p08
  /nix/store/6miw9n0c4pq1szgn1smzw5k821yswnnq-python2.7-pyOpenSSL-19.0.0
  /nix/store/6nz66xsx5nmk5dcbf154xfnx6j30qxng-python-2.7.16
  /nix/store/a0rz4s781sw9gfi2hvncw577ahh74x3r-libffi-3.2.1
  /nix/store/iqr5r6i8lc4jxbs0pllqxccwzn53mgag-db-5.3.28
  /nix/store/k3wwd408i8qjrg7rnx4zpd3w1afkjx4l-python2.7-cryptography-2.5
  /nix/store/kk2lcd28a6b3j3yb1xmhqv164l0v59j0-openssl-1.0.2r
  /nix/store/ksw6qcga7fvd6ya5y9mx8amlwl9zqpys-python2.7-cffi-1.12.1
  /nix/store/l92cg3agcrj8wli978jrkafb4kbhlvnq-sqlite-3.28.0
  /nix/store/qkpvxg4hh4a7w0ss8ychw3gfgx4iam3q-google-cloud-sdk-222.0.0
  /nix/store/va73fgg030fwimmjpalap5f3wbmnbgz6-python2.7-crcmod-1.7
  /nix/store/xq0di4f3zfz5ycdjivwmm5i43qgmmm2a-python2.7-setuptools-40.8.0
copying path '/nix/store/6miw9n0c4pq1szgn1smzw5k821yswnnq-python2.7-pyOpenSSL-19.0.0' from 'https://cache.nixos.org'...
copying path '/nix/store/26ani5lvmf4yanr8m7jc1z3irdk16yqg-gdbm-1.18.1' from 
 https://cache.nixos.org'...
copying path '/nix/store/iqr5r6i8lc4jxbs0pllqxccwzn53mgag-db-5.3.28' from 'https://cache.nixos.org'...
copying path '/nix/store/a0rz4s781sw9gfi2hvncw577ahh74x3r-libffi-3.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/kk2lcd28a6b3j3yb1xmhqv164l0v59j0-openssl-1.0.2r' from 'https://cache.nixos.org'...
copying path '/nix/store/l92cg3agcrj8wli978jrkafb4kbhlvnq-sqlite-3.28.0' from 'https://cache.nixos.org'...
copying path '/nix/store/4wkmn4v3ah06wkincrpqqqwwnvg8fdxd-readline-6.3p08' from 'https://cache.nixos.org'...
copying path '/nix/store/6nz66xsx5nmk5dcbf154xfnx6j30qxng-python-2.7.16' from 'https://cache.nixos.org'...
copying path '/nix/store/ksw6qcga7fvd6ya5y9mx8amlwl9zqpys-python2.7-cffi-1.12.1' from 'https://cache.nixos.org'...
copying path '/nix/store/k3wwd408i8qjrg7rnx4zpd3w1afkjx4l-python2.7-cryptography-2.5' from 'https://cache.nixos.org'...
copying path '/nix/store/xq0di4f3zfz5ycdjivwmm5i43qgmmm2a-python2.7-setuptools-40.8.0' from 'https://cache.nixos.org'...
copying path '/nix/store/va73fgg030fwimmjpalap5f3wbmnbgz6-python2.7-crcmod-1.7' from 'https://cache.nixos.org'...
copying path '/nix/store/qkpvxg4hh4a7w0ss8ychw3gfgx4iam3q-google-cloud-sdk-222.0.0' from 'https://cache.nixos.org'...
building '/nix/store/m2667b4ibch358rrzxb0ahp8afj2vf9z-user-environment.drv'...
created 1927 symlinks in user environment

To Reproduce
Try generating a signed URL.

Expected behavior
It should generate a signed URL (as described at https://cloud.google.com/storage/docs/access-control/signing-urls-with-helpers)

Metadata

$ nix run nixpkgs.nix-info -c nix-info -m

[1 copied, 0.0 MiB DL]
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.59, NixOS, 19.03.173116.f4fcdac99fa (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - channels(toraritte): `""`
 - channels(root): `"nixos-19.03.173228.93ea6db29cc, nixos-unstable-19.09pre187507.525eaf407d4, nixpkgs-unstable
-19.09pre187222.002b853782e"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Thank you for looking into this!

@toraritte toraritte added the 0.kind: bug Something is broken label Aug 20, 2019
@red-hood
Copy link

red-hood commented Sep 8, 2019

The same issue still exists in google-cloud-sdk-255.0.0

@andir andir added this to the 19.09 milestone Sep 9, 2019
@andir andir self-assigned this Sep 9, 2019
@andir andir mentioned this issue Sep 9, 2019
10 tasks
@vcunat vcunat closed this as completed in 4fdbdce Oct 13, 2019
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this issue Jan 21, 2020
Previously only direct dependencies were available in the python search
path. Transitive dependencies would not be available and thus a few
features would not work due to import errors. Those import errors were
being caugth and gave a (wrong) hint why it wouldn't work. By using
`python.withPackages` instead of the crafted search path with only the
direct dependencies those missing feature should now be working.

See issue NixOS#67094 for details on the observed errors.

Fixes NixOS#67094

(cherry picked from commit 4fdbdce)
@felschr
Copy link
Member

felschr commented Jun 7, 2022

I'm still getting this error message when running gsutil signurl on NixOS unstable.

@felschr
Copy link
Member

felschr commented Jun 7, 2022

I guess it's probably caused by 8b535fb, which replaced pyopenssl with openssl in pythonEnv.
There's a comment about this change in the PR: #141773

@ahirner
Copy link
Contributor

ahirner commented Jan 29, 2023

@felschr can confirm the error with recent pkgs:

❯ gcloud --version
Google Cloud SDK 408.0.1
bq 2.0.81
core 2022.11.01
gcloud-crc32c 1.0.0
gsutil 5.16

There's a comment about this change in the PR: #141773

Couldn't find it in commit history nor github discussion thread. What was the comment? Knowing the reason for this change will be helpful to open a new issue.

@mrene
Copy link
Contributor

mrene commented Apr 6, 2024

#301986 fixes it for gcloud storage sign-url but gsutil is still broken due to GoogleCloudPlatform/gsutil#1753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

6 participants