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

rflash can not display error if firmware file upload has failed #5312

Closed
gurevichmark opened this issue Jun 21, 2018 · 2 comments
Closed

rflash can not display error if firmware file upload has failed #5312

gurevichmark opened this issue Jun 21, 2018 · 2 comments

Comments

@gurevichmark
Copy link
Contributor

Today rflash command uploads files in parallel by forking a process for each node. If upload operation fails the error is saved in node_info hash. At the end the summary is displayed for the attempted range of nodes and errors are displayed for each failed node.

However, since each upload happens in a separate process, the node_info is just a copy, so that when the upload finished, the node_info hash does not have the errors saved by each process. And we display generic "BMC is not ready" message.

The solution is probably to return the error string from forked process instead of 1 if there is an upload error. Hopefully the returned string can be caught by the main process and saved into node_info hash.

[root@briggs01 gurevich]# rflash mid05tor12cn15 -a /tmp/gurevich/fw.tar
Attempting to upload /tmp/gurevich/fw.tar, please wait...
mid05tor12cn15: Failed to upload update file /tmp/gurevich/fw.tar : 400 Bad Request - Version already exists or failed to be extracted
-------------------------------------------------------
Firmware update complete: Total=1 Success=0 Failed=1
mid05tor12cn15: BMC is not ready
-------------------------------------------------------
[root@briggs01 gurevich]#
@gurevichmark gurevichmark self-assigned this Jun 21, 2018
@gurevichmark gurevichmark added this to the 2.14.2 milestone Jun 21, 2018
@gurevichmark
Copy link
Contributor Author

gurevichmark commented Jun 22, 2018

Tried Python version, but it has its own problem:

  • Running with debug on, the error is displayed, but RC is 0
[root@briggs01 xcat]# rflash mid05tor12cn15 -a /tmp/gurevich/fw.tar -V
[briggs01]: Running command in Python
[briggs01]: Attempting to upload /tmp/gurevich/fw.tar, please wait...
[briggs01]: Fri Jun 22 09:47:29 2018 mid05tor12cn15: [openbmc_debug] login curl -k -c cjar -b cjar -X POST -H "Content-Type: application/json" https://172.11.139.15/login -d '{"data": ["root", "xxxxxx"]}'
[briggs01]: Fri Jun 22 09:47:30 2018 mid05tor12cn15: [openbmc_debug] login 200 OK
[briggs01]: Fri Jun 22 09:47:30 2018 mid05tor12cn15: [openbmc_debug] upload_firmware curl -k -c cjar -b cjar -X PUT -H "Content-Type: application/octet-stream" -T '/tmp/gurevich/fw.tar' https://172.11.139.15/upload/image/ -s
[briggs01]: Fri Jun 22 09:47:40 2018 mid05tor12cn15: [openbmc_debug] upload_firmware Failed to upload update file /tmp/gurevich/fw.tar : 400 Bad Request-Version already exists or failed to be extracted
[root@briggs01 xcat]# echo $?
0
[root@briggs01 xcat]#
  • Running with debug off, no error is displayed, and RC is 0
[root@briggs01 xcat]# vi ./lib/perl/xCAT/OPENBMC.pm
[root@briggs01 xcat]# rflash mid05tor12cn15 -a /tmp/gurevich/fw.tar -V
[briggs01]: Running command in Python
[briggs01]: Attempting to upload /tmp/gurevich/fw.tar, please wait...
[root@briggs01 xcat]# echo $?
0
[root@briggs01 xcat]#

@hu-weihua
Copy link

@gurevichmark, Could you help to push this fix forward? If this fix could not catch 2.14.2 release, could you help to move this to 2.14.3? thanks

@zet809 zet809 modified the milestones: 2.14.2, 2.14.3 Jul 11, 2018
@zet809 zet809 added the sprint1 label Jul 11, 2018
@xcat2 xcat2 deleted a comment from chuckbrazie Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants