sw-patch upload patch failed with "AttributeError: 'cStringIO.StringO' object has no attribute 'fileno'"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
StarlingX |
Fix Released
|
Low
|
Don Penney |
Bug Description
Title
-----
sw-patch upload patch failed with "AttributeError: 'cStringIO.StringO' object has no attribute 'fileno'"
Brief Description
-----------------
In all-in-one environment, use sw-patch upload function, got failed.
Severity
--------
Critical: System/Feature is not usable after the defect
Steps to Reproduce
------------------
1. $MY_REPO/
then got EXAMPLE_0001.patch
2. sudo sw-patch upload EXAMPLE_0001.patch
3. got failed with AttributeError: 'cStringIO.StringO' object has no attribute 'fileno' in /var/log/
Expected Behavior
------------------
patch will be uploaded and then applied.
Actual Behavior
----------------
uploaded failed
Reproducibility
---------------
<Reproducible/
State if the issue is 100% reproducible or intermittent. If it is intermittent, state the frequency of occurrence
System Configuration
-------
One node system
Branch/Pull Time/Commit
-------
master branch 201b94d on 7 Sep
https:/
Timestamp/Logs
--------------
[wrsroot@
2018-11-
2018-11-
2018-11-
Traceback (most recent call last):
File "/usr/lib64/
self.result = application(
File "/usr/lib64/
return self.v1(environ, start_response)
File "/usr/lib/
return self.applicatio
File "/usr/lib/
return super(Pecan, self)._
File "/usr/lib/
self.
File "/usr/lib/
result = controller(*args, **kwargs)
File "/usr/lib64/
src = fileitem.
AttributeError: 'cStringIO.StringO' object has no attribute 'fileno'
2018-11-
/usr/lib64/
88 @expose('json')
89 @expose(
90 def upload(self):
91 assert isinstance(
92 fileitem = request.
93
94 if not fileitem.filename:
95 return dict(error="Error: No file uploaded")
96
97 fn = '/scratch/' + os.path.
98 # This technique cannot copy a very large file. It
99 # requires a lot of memory as all data from the
100 # source file is read into memory then written to
101 # the destination file one chunk
102 # open(fn, 'wb').write(
103
104 # Copying file by chunks using OS system calls
105 # requires much less memory. A larger chunk
106 # size can be used to improve the copy speed;
107 # currently 64K chunk size is selected
108 dst = os.open(fn, os.O_WRONLY | os.O_CREAT)
109 src = fileitem.
110 size = 64 * 1024
111 n = size
112 while n >= size:
113 s = os.read(src, size)
114 n = os.write(dst, s)
115 os.close(dst)
[wrsroot@
● sw-patch-
Loaded: loaded (/usr/lib/
Active: active (running) since Tue 2018-11-13 02:21:02 UTC; 17s ago
Process: 5803 ExecStop=
Process: 5895 ExecStart=
Main PID: 5902 (python)
Tasks: 4
Memory: 54.3M
CGroup: /system.
└─5902 python /usr/sbin/
[wrsroot@
An internal error has occurred. Please check /var/log/
tags: | added: stx.update |
Changed in starlingx: | |
assignee: | nobody → Don Penney (dpenney) |
Changed in starlingx: | |
status: | New → Triaged |
tags: |
added: stx.2.0 removed: stx.2019.05 |
The stx-update/ extras/ scripts/ patch_build. sh utility is the designer-level tool for building patches, which calls the cgcs-patch/ bin/patch_ build util after setting required environment variables.
$ extras/ scripts/ patch_build. sh --help
--unremovable Marks patch as unremovable
--reboot- required <Y|N> Marks patch as reboot-required (default=Y)
--controller <rpm> New package for controller
--compute- lowlatency <rpm> New package for compute-lowlatency node
--controller- compute <rpm> New package for combined node
--controller- compute- lowlatency <rpm> New package for lowlatency combined node
Usage: patch_build [ <args> ] ... <rpm list>
Options:
--id <id> Patch ID
--release <version> Platform release version
--status <status> Patch Status Code (ie. O, R, V)
--summary <summary> Patch Summary
--desc <description> Patch Description
--warn <warnings> Patch Warnings
--inst <instructions> Patch Install Instructions
--req <patch_id> Required Patch
--compute <rpm> New package for compute node
--storage <rpm> New package for storage node
--all-nodes <rpm> New package for all node types
You must specify the RPM file(s) to be included in the patch. The build command used as described in this bug report includes no RPM files, resulting in a malformed patch. And it seems this particular malformation is not handled well by the patching system.