Error with PyYaml on build #8376

Closed
opened 2025-12-29 20:35:55 +01:00 by adam · 2 comments
Owner

Originally created by @ymasson on GitHub (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 https://github.com/yaml/pyyaml/issues/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

Originally created by @ymasson on GitHub (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 https://github.com/yaml/pyyaml/issues/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 -
adam added the type: bug label 2025-12-29 20:35:55 +01:00
adam closed this issue 2025-12-29 20:35:55 +01:00
Author
Owner

@abhi1693 commented on GitHub (Jul 27, 2023):

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

@abhi1693 commented on GitHub (Jul 27, 2023): It's not a direct bug of NetBox and this will be done on the next release.
Author
Owner

@DanSheps commented on GitHub (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 commented on GitHub (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](https://github.com/netbox-community/netbox-docker/) issue tracker)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8376