Skip to content

cmd-import fails on unexpected timestamp format #4308

@jbtrystram

Description

@jbtrystram

Trying to import an image build "the old way" with cosa import fails with :

cosa import docker://quay.io/fedora/fedora-coreos:testing-devel                                                                                     
Getting image source signatures
........
Writing manifest to image destination
layers already present: 0; layers needed: 51 (945.4 MB)
 1.51 MiB [████████████████████] (0s) Fetched ostree chunk eb780a687485fe3dc43                                                                                Wrote: ostree-unverified-image:oci-archive:/home/jib/cosa/fcos/tmp/cosa-import-n0zoy31i/out.ociarchive => 072db838f2c4de1a5751b5d2b74f5b8ecec6b7c2429e5dec74f60ae4865fc9c1
3727 metadata, 21768 content objects imported; 1.7 GB content written                                                                                         
1427 metadata, 3593 content objects imported; 212.8 kB content written                                                                                       
Traceback (most recent call last):
  File "/usr/lib/coreos-assembler/cmd-import", line 213, in <module>
    with open(f'{destdir}/meta.json', 'w') as f:
    ^^^^^^
  File "/usr/lib/coreos-assembler/cmd-import", line 57, in main
    tmp_lockfile, tmp_commitmeta = generate_lockfile_and_commitmeta(tmpd, ostree_commit, build_meta)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/coreos-assembler/cmd-import", line 120, in generate_build_meta
    commitmeta = {
    
  File "/usr/lib/coreos-assembler/cmd-import", line 208, in parse_timestamp
    shutil.move(tmp_oci_archive, f'{destdir}/{build_meta['images']['ostree']['path']}')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/_strptime.py", line 789, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/_strptime.py", line 555, in _strptime
    raise ValueError("time data %r does not match format %r" %
                     (data_string, format))
ValueError: time data '2025-09-09T13:23:21Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
failed to execute cmd-import: exit status 1

However, a rawhide image imports fine (created with buildah) :
Comparing the manifest I see the Created field have a different format :

skopeo  inspect -n docker://quay.io/fedora/fedora-coreos:rawhide | jq '.Created'
"2025-09-08T14:40:01.168718841Z"
skopeo  inspect -n docker://quay.io/fedora/fedora-coreos:stable | jq '.Created'
"2025-09-03T02:26:27Z"

Metadata

Metadata

Assignees

Labels

jirafor syncing to jira

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions