oracle / oci-cli

Command Line Interface for Oracle Cloud Infrastructure
https://cloud.oracle.com/cloud-infrastructure
Other
452 stars 186 forks source link

Ubuntu install oci cli: ERROR: Could not install packages due to an OSError: [Errno 36] File name too long #822

Closed dburianov closed 4 months ago

dburianov commented 5 months ago

Hello I have problem with install oci cli on Ubuntu 24.04

Error:

ERROR: Could not install packages due to an OSError: [Errno 36] File name too long: '/home/burianov/lib/oracle-cli/lib/python3.12/site-packages/oci_cli/help_text_producer/data_files/man/database-management_managed-database_enable-external-container-database-management-feature-external-database-diagnostics-and-management-feature-details.1'

My OS:

PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

My kernel and arch:

Linux Latitude-5400 6.8.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Mon May 20 15:51:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Full listing:

bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16926  100 16926    0     0  35091      0 --:--:-- --:--:-- --:--:-- 35116

    ******************************************************************************
    You have started the OCI CLI Installer in interactive mode. If you do not wish
    to run this in interactive mode, please include the --accept-all-defaults option.
    If you have the script locally and would like to know more about
    input options for this script, then you can run:
    ./install.sh -h
    If you would like to know more about input options for this script, refer to:
    https://github.com/oracle/oci-cli/blob/master/scripts/install/README.rst
    ******************************************************************************
Downloading Oracle Cloud Infrastructure CLI install script from https://raw.githubusercontent.com/oracle/oci-cli/v3.2.1/scripts/install/install.py to /tmp/oci_cli_install_tmp_GtBE.
####################################################################################################################################################################################### 100.0%
Running install script.
python3 /tmp/oci_cli_install_tmp_GtBE 
/tmp/oci_cli_install_tmp_GtBE:524: SyntaxWarning: invalid escape sequence '\E'
  command = "powershell -Command \"[Environment]::SetEnvironmentVariable(\\\"PATH\\\", \\\"{};\\\" + (Get-ItemProperty -Path 'Registry::HKEY_CURRENT_USER\Environment' -Name PATH).Path, \\\"User\\\")".format(exec_dir)  # noqa: W605
-- Verifying Python version.
-- Python version 3.12.3 okay.

===> In what directory would you like to place the install? (leave blank to use '/home/burianov/lib/oracle-cli'): 
-- Creating directory '/home/burianov/lib/oracle-cli'.
-- We will install at '/home/burianov/lib/oracle-cli'.

===> In what directory would you like to place the 'oci' executable? (leave blank to use '/home/burianov/bin'): 
-- The executable will be in '/home/burianov/bin'.

===> In what directory would you like to place the OCI scripts? (leave blank to use '/home/burianov/bin/oci-cli-scripts'): 
-- Creating directory '/home/burianov/bin/oci-cli-scripts'.
-- The scripts will be in '/home/burianov/bin/oci-cli-scripts'.

===> Currently supported optional packages are: ['db (will install cx_Oracle)']
What optional CLI packages would you like to be installed (comma separated names; press enter if you don't need any optional packages)?: 
-- The optional packages installed will be ''.
-- Executing: ['sudo', 'apt-get', 'update']
Hit:1 http://gb.archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://gb.archive.ubuntu.com/ubuntu noble-updates InRelease                                                                                                                            
Hit:3 http://gb.archive.ubuntu.com/ubuntu noble-backports InRelease                                                                                                                          
Hit:4 https://download.docker.com/linux/ubuntu noble InRelease                                                                                                                               
Hit:5 https://apt.releases.hashicorp.com noble InRelease                                                                                                                           
Hit:6 http://security.ubuntu.com/ubuntu noble-security InRelease                                                                                                                   
Hit:7 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu noble InRelease                                                                                                      
Hit:8 https://ppa.launchpadcontent.net/openshot.developers/ppa/ubuntu noble InRelease                            
Hit:9 https://ppa.launchpadcontent.net/yubico/stable/ubuntu noble InRelease                                      
Hit:10 https://dl.google.com/linux/chrome/deb stable InRelease                             
Hit:11 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease             
Reading package lists... Done
W: https://ppa.launchpadcontent.net/openshot.developers/ppa/ubuntu/dists/noble/InRelease: Signature by key FBA0C227099A5360635E3D9152165BD6B9BA26FA uses weak algorithm (rsa1024)
W: https://ppa.launchpadcontent.net/yubico/stable/ubuntu/dists/noble/InRelease: Signature by key 3653E21064B19D134466702E43D5C49532CBA1A9 uses weak algorithm (rsa1024)
-- Installing python3-venv.
-- Executing: ['sudo', 'apt-get', 'install', 'python3-venv', '-y']
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-venv is already the newest version (3.12.3-0ubuntu1).
The following package was automatically installed and is no longer required:
  squashfs-tools
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
-- Trying to use python3 venv.
-- Executing: ['/home/burianov/.venv/bin/python3', '-m', 'venv', '/home/burianov/lib/oracle-cli']
-- Executing: ['/home/burianov/lib/oracle-cli/bin/pip', 'install', '--upgrade', 'pip']
Requirement already satisfied: pip in ./lib/oracle-cli/lib/python3.12/site-packages (24.0)
Collecting pip
  Using cached pip-24.1.1-py3-none-any.whl.metadata (3.6 kB)
Using cached pip-24.1.1-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-24.1.1
-- Executing: ['/home/burianov/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmp1vh8v3ym', 'wheel', '--upgrade']
Collecting wheel
  Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 kB 1.3 MB/s eta 0:00:00
Installing collected packages: wheel
Successfully installed wheel-0.43.0
-- Executing: ['/home/burianov/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmp1vh8v3ym', 'oci_cli', '--upgrade']
Collecting oci_cli
  Downloading oci_cli-3.44.1-py3-none-any.whl.metadata (7.0 kB)
Collecting oci==2.129.1 (from oci_cli)
  Downloading oci-2.129.1-py3-none-any.whl.metadata (5.2 kB)
Collecting arrow>=1.0.0 (from oci_cli)
  Downloading arrow-1.3.0-py3-none-any.whl.metadata (7.5 kB)
Collecting certifi (from oci_cli)
  Downloading certifi-2024.6.2-py3-none-any.whl.metadata (2.2 kB)
Collecting click==8.0.4 (from oci_cli)
  Downloading click-8.0.4-py3-none-any.whl.metadata (3.2 kB)
Collecting cryptography<43.0.0,>=3.2.1 (from oci_cli)
  Downloading cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.3 kB)
Collecting jmespath==0.10.0 (from oci_cli)
  Downloading jmespath-0.10.0-py2.py3-none-any.whl.metadata (8.0 kB)
Collecting python-dateutil<3.0.0,>=2.5.3 (from oci_cli)
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2016.10 (from oci_cli)
  Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting six>=1.15.0 (from oci_cli)
  Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting terminaltables==3.1.10 (from oci_cli)
  Downloading terminaltables-3.1.10-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting pyOpenSSL<25.0.0,>=17.5.0 (from oci_cli)
  Downloading pyOpenSSL-24.1.0-py3-none-any.whl.metadata (12 kB)
Collecting PyYAML<=6.0.1,>=5.4 (from oci_cli)
  Downloading PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting prompt-toolkit<=3.0.43,>=3.0.38 (from oci_cli)
  Downloading prompt_toolkit-3.0.43-py3-none-any.whl.metadata (6.5 kB)
Collecting circuitbreaker<2.0.0,>=1.3.1 (from oci==2.129.1->oci_cli)
  Downloading circuitbreaker-1.4.0.tar.gz (9.7 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting types-python-dateutil>=2.8.10 (from arrow>=1.0.0->oci_cli)
  Downloading types_python_dateutil-2.9.0.20240316-py3-none-any.whl.metadata (1.8 kB)
Collecting cffi>=1.12 (from cryptography<43.0.0,>=3.2.1->oci_cli)
  Downloading cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB)
Collecting wcwidth (from prompt-toolkit<=3.0.43,>=3.0.38->oci_cli)
  Downloading wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB)
Collecting pycparser (from cffi>=1.12->cryptography<43.0.0,>=3.2.1->oci_cli)
  Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Downloading oci_cli-3.44.1-py3-none-any.whl (48.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.5/48.5 MB 2.8 MB/s eta 0:00:00
Downloading click-8.0.4-py3-none-any.whl (97 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.5/97.5 kB 2.6 MB/s eta 0:00:00
Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Downloading oci-2.129.1-py3-none-any.whl (26.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 26.8/26.8 MB 2.8 MB/s eta 0:00:00
Downloading terminaltables-3.1.10-py2.py3-none-any.whl (15 kB)
Downloading arrow-1.3.0-py3-none-any.whl (66 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.4/66.4 kB 2.0 MB/s eta 0:00:00
Downloading cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl (3.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 2.8 MB/s eta 0:00:00
Downloading prompt_toolkit-3.0.43-py3-none-any.whl (386 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 386.1/386.1 kB 2.3 MB/s eta 0:00:00
Downloading pyOpenSSL-24.1.0-py3-none-any.whl (56 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 kB 1.7 MB/s eta 0:00:00
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 kB 2.7 MB/s eta 0:00:00
Downloading pytz-2024.1-py2.py3-none-any.whl (505 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 505.5/505.5 kB 2.5 MB/s eta 0:00:00
Downloading PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (724 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 725.0/725.0 kB 2.8 MB/s eta 0:00:00
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Downloading certifi-2024.6.2-py3-none-any.whl (164 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.4/164.4 kB 2.4 MB/s eta 0:00:00
Downloading cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (477 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 477.6/477.6 kB 3.0 MB/s eta 0:00:00
Downloading types_python_dateutil-2.9.0.20240316-py3-none-any.whl (9.7 kB)
Downloading wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Downloading pycparser-2.22-py3-none-any.whl (117 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 2.6 MB/s eta 0:00:00
Building wheels for collected packages: circuitbreaker
  Building wheel for circuitbreaker (pyproject.toml) ... done
  Created wheel for circuitbreaker: filename=circuitbreaker-1.4.0-py3-none-any.whl size=7519 sha256=27b8d2e33a949170e661114e2f00739c925f48e8dd043f1d7dfe657b57ef4696
  Stored in directory: /tmp/tmp1vh8v3ym/wheels/80/f5/d3/54d902a3649acdc8317b340ce43bc095c61102e3fdbdb7c7bb
Successfully built circuitbreaker
Installing collected packages: wcwidth, pytz, circuitbreaker, types-python-dateutil, terminaltables, six, PyYAML, pycparser, prompt-toolkit, jmespath, click, certifi, python-dateutil, cffi, cryptography, arrow, pyOpenSSL, oci, oci_cli
ERROR: Could not install packages due to an OSError: [Errno 36] File name too long: '/home/burianov/lib/oracle-cli/lib/python3.12/site-packages/oci_cli/help_text_producer/data_files/man/database-management_managed-database_enable-external-container-database-management-feature-external-database-diagnostics-and-management-feature-details.1'

Traceback (most recent call last):
  File "/tmp/oci_cli_install_tmp_GtBE", line 722, in <module>
    main()
  File "/tmp/oci_cli_install_tmp_GtBE", line 677, in main
    install_cli(install_dir, tmp_dir, cli_version, OPTIONAL_FEATURES)
  File "/tmp/oci_cli_install_tmp_GtBE", line 319, in install_cli
    exec_command(cmd, env=env)
  File "/tmp/oci_cli_install_tmp_GtBE", line 141, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/burianov/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmp1vh8v3ym', 'oci_cli', '--upgrade']' returned non-zero exit status 1.
KalpanaRamasamy90 commented 4 months ago

This is an issue in OS - Maximum Path Length Limitation issue and not a CLI installation issue There should be steps to enable the max path length similar to Windows as below https://pip.pypa.io/warnings/enable-long-paths Can you please check and try installing ?

Please refer to the link for OS and supported Python versions for CLI https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cliconcepts.htm

KalpanaRamasamy90 commented 4 months ago

Please reopen the issue if issue is not solved or you have more questions, Thanks!

peltho commented 3 months ago

One simple workaround is to get rid of man files. Just head over https://github.com/oracle/oci-cli/releases, then:

ct-ucsd commented 2 months ago

One simple workaround is to get rid of man files. Just head over https://github.com/oracle/oci-cli/releases, then:

  • download the latest one
  • open the .whl archive
  • remove the oci_cli/help_text_producer/data_files/man content
  • execute pip install oci_cli-*-py2.py3-none-any.whl

this worked for me. I have analyst-level knowledge on this sort of thing, but I omitted /man/ files from namelist() then extracted that subset to the top of my drive to avoid further long path errors.

drocco007 commented 1 month ago

One simple workaround is to get rid of man files. Just head over https://github.com/oracle/oci-cli/releases, then:

  • download the latest one
  • open the .whl archive
  • remove the oci_cli/help_text_producer/data_files/man content
  • execute pip install oci_cli-*-py2.py3-none-any.whl

Thanks for the tip; here’s the command I used to remove the man pages (Linux):

zip -d oci_cli-3.49.3-py3-none-any.whl 'oci_cli/help_text_producer/data_files/man/*'

Since a wheel is a zipfile you can work on it directly without unpacking it.