#1046 undefined behavior when there's no updates for ostree, pungi-wait-for-signed-ostree-handler
Closed: Fixed 5 years ago Opened 5 years ago by pbrobinson.

There's probably a couple of issues here. I'm not 100% due to the crash in pungi-wait-for-signed-ostree-handler.

When there's no changes in a ostree rpm-ostree reports no changes so doesn't supply an updated reference:


No apparent changes since previous commit; use --force-nocache to override
Not updating ref as configured

When this happens pungi-wait-for-signed-ostree-handler crashes where it should actually handle this correctly as its a proper usecase.


COMMAND: pungi-wait-for-signed-ostree-handler ostree


Traceback (most recent call last):
File "/usr/bin/pungi-wait-for-signed-ostree-handler", line 31, in <module>
path = '%s/objects/%s/%s.commitmeta' % (repo, commit[:2], commit[2:])
TypeError: 'NoneType' object is not subscriptable

This then causes errors in the pungi global log:


2018-09-13 07:56:04 [WARNING ] Failed to invoke notification script.
2018-09-13 07:56:04 [INFO ] [DONE ] OSTree phase for variant IoT, arch x86_64 (task id: 29644546)
2018-09-13 08:00:14 [ERROR ] Unable to find commitid file

I don't know if the last "Unable to find commitid file" is as a result of the above crash but if there's no updates there won't be a commitid file so it should be handled gracefully too if it's difference to the above crash because it's also expected.


What is the problem that you have?
The crash has no effect on anything, it just causes pungi not to wait for something that is not going to happen (though obviously it's a bug and should be fixed in #1048).
The error could either be changed to a warning, or maybe only printed when we expect to find the commit ID.
I fail to see how any of that makes a big difference. The end result in the compose and ostree repo will be identical to what is there now.

Probably the best thing is for pungi to use --touch-if-changed, and then take explicit action depending on that. See for example recent code in coreos-assembler for this as well as what's done in FAHC.

Metadata Update from @lsedlar:
- Issue set to the milestone: 4.1.29

5 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1048 Merged 5 years ago