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

Error with PyYaml on build #13281

Closed
ymasson opened this issue Jul 27, 2023 · 2 comments
Closed

Error with PyYaml on build #13281

ymasson opened this issue Jul 27, 2023 · 2 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@ymasson
Copy link

ymasson commented Jul 27, 2023

NetBox version

3.5.6

Python version

3.11

Steps to Reproduce

I build the Docker image with netbox-docker.
And i have this error:

#12 12.85 Collecting PyYAML==6.0 (from -r /requirements.txt (line 30))
#12 12.95   Downloading https://xxxxxx/artifactory/api/pypi/default-pypi/packages/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz (124 kB)
#12 12.98      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.0/125.0 kB 4.6 MB/s eta 0:00:00
#12 13.14   Installing build dependencies: started
#12 17.76   Installing build dependencies: finished with status 'done'
#12 17.76   Getting requirements to build wheel: started
#12 18.04   Getting requirements to build wheel: finished with status 'error'
#12 18.05   error: subprocess-exited-with-error
#12 18.05   
#12 18.05   × Getting requirements to build wheel did not run successfully.
#12 18.05   │ exit code: 1
#12 18.05   ╰─> [54 lines of output]
#12 18.05       running egg_info
#12 18.05       writing lib/PyYAML.egg-info/PKG-INFO
#12 18.05       writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
#12 18.05       writing top-level names to lib/PyYAML.egg-info/top_level.txt
#12 18.05       Traceback (most recent call last):
#12 18.05         File "/opt/netbox/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
#12 18.05           main()
#12 18.05         File "/opt/netbox/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
#12 18.05           json_out['return_val'] = hook(**hook_input['kwargs'])
#12 18.05                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 18.05         File "/opt/netbox/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
#12 18.05           return hook(config_settings)
#12 18.05                  ^^^^^^^^^^^^^^^^^^^^^
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
#12 18.05           return self._get_build_requires(config_settings, requirements=['wheel'])
#12 18.05                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
#12 18.05           self.run_setup()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
#12 18.05           exec(code, locals())
#12 18.05         File "<string>", line 288, in <module>
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
#12 18.05           return distutils.core.setup(**attrs)
#12 18.05                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
#12 18.05           return run_commands(dist)
#12 18.05                  ^^^^^^^^^^^^^^^^^^
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
#12 18.05           dist.run_commands()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
#12 18.05           self.run_command(cmd)
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
#12 18.05           super().run_command(command)
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
#12 18.05           cmd_obj.run()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 314, in run
#12 18.05           self.find_sources()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
#12 18.05           mm.run()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 551, in run
#12 18.05           self.add_defaults()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
#12 18.05           sdist.add_defaults(self)
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
#12 18.05           super().add_defaults()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
#12 18.05           self._add_defaults_ext()
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
#12 18.05           self.filelist.extend(build_ext.get_source_files())
#12 18.05                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#12 18.05         File "<string>", line 204, in get_source_files
#12 18.05         File "/tmp/pip-build-env-ak_jjlvj/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
#12 18.05           raise AttributeError(attr)
#12 18.05       AttributeError: cython_sources
#12 18.05       [end of output]

I've found that issue yaml/pyyaml#736
The PyYaml version in requirement.txt is fixed to 6.0 (https://github.com/netbox-community/netbox/blob/v3.5.6/requirements.txt#L31)

I've patched the netbox-docker Dockerfile (https://github.com/netbox-community/netbox-docker/blob/release/Dockerfile#L33-L44) with:

sed -i -e 's/PyYAML==6.0/PyYAML==6.0.1/' /requirements.txt

and it fixes.

maybe the requirements.txt should be updated with PyYAML==6.0.1

Expected Behavior

Observed Behavior

@ymasson ymasson added the type: bug A confirmed report of unexpected behavior in the application label Jul 27, 2023
@abhi1693
Copy link
Member

It's not a direct bug of NetBox and this will be done on the next release.

@DanSheps
Copy link
Member

DanSheps commented Jul 27, 2023

Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.5.6 (without docker). Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.

(netbox-docker issues should be opened up against the netbox-docker issue tracker)

@DanSheps DanSheps closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants