Skip to content

Incorrect reporting with failure in running fs_hash.sh #263

@nishakm

Description

@nishakm

Describe the bug
If there is any failure in the script fs_hash.sh, the error message that gets reported is WARNING - report - Cannot retrieve full image metadata.

To Reproduce
Steps to reproduce the behavior:

  1. Start with machine with no attr installed
  2. Run tern report -i hello-world
  3. See log - says WARNING - report - Cannot retrieve full image metadata

Error in terminal

$ tern -l report -i hello-world:latest                                                                                                                                                            
2019-05-13 08:10:53,500 - DEBUG - __main__ - Starting...                                                                                                                                                                               
2019-05-13 08:10:53,501 - DEBUG - report - Setting up...                                                                                                                                                                               
2019-05-13 08:10:53,502 - DEBUG - container - Checking if image "hello-world:latest" is available on disk...                                                                                                                           
2019-05-13 08:10:53,505 - DEBUG - container - Image "hello-world:latest" found                                                                                                                                                         
2019-05-13 08:10:53,515 - DEBUG - rootfs - Running command: sudo /home/nisha/terndev/lib/python3.7/site-packages/tern/tools/fs_hash.sh /home/nisha/terndev/tern/temp/cdccdf50922d90e847e097347de49119be0f17c18b4a2d98da9919fa5884479d/c
ontents                                                                                                                                                                                                                                
2019-05-13 08:10:53,548 - WARNING - report - Cannot retrieve full image metadata                                                                                                                                                       
2019-05-13 08:10:53,548 - DEBUG - report - Teardown...                                                                                                                                                                                 
2019-05-13 08:10:53,549 - DEBUG - rootfs - Running command: sudo rm -rf temp/mergedir                                                                                                                                                  
2019-05-13 08:10:53,559 - DEBUG - rootfs - Running command: sudo rm -rf temp/workdir                                                                                                                                                   
2019-05-13 08:10:53,582 - DEBUG - __main__ - Report completed.                                                                                                                                                                         
2019-05-13 08:10:53,583 - DEBUG - __main__ - Finished                                                                                                                                                                                  
(terndev) nisha@ubuntu:~/terndev/tern$ tern -l report -i debian:buster                                                                                                                                                                 
2019-05-13 08:11:05,745 - DEBUG - __main__ - Starting...                                                                                                                                                                               
2019-05-13 08:11:05,745 - DEBUG - report - Setting up...                                                                                                                                                                               
2019-05-13 08:11:05,746 - DEBUG - container - Checking if image "debian:buster" is available on disk...                                                                                                                                
2019-05-13 08:11:05,749 - DEBUG - container - Image "debian:buster" found                                                                                                                                                              
2019-05-13 08:11:08,209 - DEBUG - rootfs - Running command: sudo /home/nisha/terndev/lib/python3.7/site-packages/tern/tools/fs_hash.sh /home/nisha/terndev/tern/temp/62fa53694b29fbc60f7088f083057844e0f90f3bd5c9910086f91bac962980e0/c
ontents                                                                                                                                                                                                                                
2019-05-13 08:11:13,624 - WARNING - report - Cannot retrieve full image metadata                                                                                                                                                       
2019-05-13 08:11:13,625 - DEBUG - report - Teardown...                                                                                                                                                                                 
2019-05-13 08:11:13,626 - DEBUG - rootfs - Running command: sudo rm -rf temp/mergedir
2019-05-13 08:11:13,633 - DEBUG - rootfs - Running command: sudo rm -rf temp/workdir
2019-05-13 08:11:13,795 - DEBUG - __main__ - Report completed.
2019-05-13 08:11:13,796 - DEBUG - __main__ - Finished

Expected behavior

2019-05-13 08:10:53,548 - ERROR - report - Error in running script fs_hash.sh

Environment you are running Tern on
Enter all that apply

  • Operating System: VMware Fusion VM running Ubuntu 18.04 LTS
  • Python version: 3.7

Metadata

Metadata

Assignees

Labels

bugSomething went wrong

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions