Sphinx raises 'ImageDraw' object has no attribute 'textsize' error

Bug #2026345 reported by Kenta Fukaya
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Low
Michael Johnson
Ironic
Fix Released
Low
Mahnoor Asghar
OpenStack Compute (nova)
Fix Released
Low
Sylvain Bauza
OpenStack Identity (keystone)
Confirmed
Low
Unassigned
networking-bgpvpn
New
Undecided
Unassigned
octavia
In Progress
Low
Gregory Thiemonge
tacker
Fix Released
Undecided
Unassigned

Bug Description

Pillow version 10.0 or higher sphinx raises error.

'''
 'ImageDraw' object has no attribute 'textsize'
'''

Tacker specs use sphinx and pillow to build some diagrams in .rst file.
Pillow remove ImageDraw.textsize() form version 10.0[1],
but sphinx use ImageDraw.textsize().

[1] https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#font-size-and-offset-methods

Revision history for this message
Corey Bryant (corey.bryant) wrote :

I'm also hitting this with at least designate, nova, and keystone when building packages for ubuntu for bobcat (on ubuntu mantic). I see upper-constraints is pinned at 9.5.0 currently so that explains why it's not hit upstream yet.

Revision history for this message
Corey Bryant (corey.bryant) wrote :
Revision history for this message
Michael Johnson (johnsom) wrote :

FYI, I posted a PR for this back in February here: https://github.com/blockdiag/blockdiag/pull/171

Revision history for this message
Kenta Fukaya (fukayan) wrote :

Tacker solved this problem by using Pillow version 9.5.
https://review.opendev.org/c/openstack/tacker-specs/+/887772.

Thanks for sharing so much information.

Revision history for this message
Elod Illes (elod-illes) wrote :

Corey is right. In most cases this issue won't come until the upper constraints of Pillow / Sphinx is not bumped [1] in openstack/requirements repository. Nevertheless, the problem exists and will need a fix / workaround (better than pinning? best would be with the above linked PR?) in the future.

[1] reproduced in openstack/nova with bumping the constrained versions to recent versions in upper-constraints.txt:

< Pillow===10.0.0
---
> Pillow===9.5.0
299c299
< docutils===0.20.1
---
> docutils===0.17.1
407c407
< Sphinx===7.1.2
---
> Sphinx===4.5.0

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :
summary: - Shpinx raise 'ImageDraw' object has no attribute 'textsize' error.
+ Sphinx raises 'ImageDraw' object has no attribute 'textsize' error
Changed in designate:
status: New → Fix Released
importance: Undecided → Low
Changed in designate:
assignee: nobody → Michael Johnson (johnsom)
Changed in octavia:
assignee: nobody → Gregory Thiemonge (gthiemonge)
importance: Undecided → Low
status: New → Confirmed
Changed in octavia:
status: Confirmed → In Progress
Revision history for this message
Amit Uniyal (auniyal) wrote :
Kenta Fukaya (fukayan)
Changed in tacker:
status: New → Fix Released
Revision history for this message
Riccardo Pittau (rpittau) wrote :

I proposed a revert to Pillow 9.5.0 in upper constraints until we can found an alternative to render sequence diagrams
A valid tool could be PlantUML https://plantuml.com/ that uses graphviz

https://review.opendev.org/c/openstack/requirements/+/897537

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to octavia (master)

Reviewed: https://review.opendev.org/c/openstack/octavia/+/897519
Committed: https://opendev.org/openstack/octavia/commit/c4a162ab40023884d33ecb3cfe3f47801d6023bc
Submitter: "Zuul (22348)"
Branch: master

commit c4a162ab40023884d33ecb3cfe3f47801d6023bc
Author: Gregory Thiemonge <email address hidden>
Date: Fri Oct 6 09:12:17 2023 +0200

    Disable seqdiag in the spec docs

    The tls-data-security specs use seqdiag to describe communication between
    some components.
    seqdiag is unmaintained and doesn't work with recent Pillow releases (10.0.1).
    Disable the generation of those diagrams as they are part of old specs.

    Also remove the dependency on seqdiag

    Disable octavia-grenade-skip-level which will be fixed in another commit

    Partial-Bug: #2026345

    Change-Id: I6b5c5d6c651dac223a205409c49085faf78cff15

Changed in ironic:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

Went through another bump/unbump cycle, see https://review.opendev.org/c/openstack/requirements/+/906262. Maybe affected projects can reconsider judging replacing outdated libraries as "low" priority only.

Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

FWIW, about Nova, I'll put all the blockdiag code that's inline our docs tree to be kept in separate .dia files into static/images and I'll generate the SVG files statically once.
After that, I'll just link to the generated SVG files and will remove the blockdiag dependency.

Patch to come up hopefully in the next day (again, only about Nova, but other projects are free to do the same).

Changed in nova:
assignee: nobody → Sylvain Bauza (sylvain-bauza)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/906309

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/906309
Committed: https://opendev.org/openstack/nova/commit/cc25813b6d07e00dbdfb52f5b1c8bedfc25c74ff
Submitter: "Zuul (22348)"
Branch: master

commit cc25813b6d07e00dbdfb52f5b1c8bedfc25c74ff
Author: Sylvain Bauza <email address hidden>
Date: Mon Jan 22 15:55:47 2024 +0100

    doc: drop blockdiag usage

    Since blockdiag seems a bit unmaintenained, let's just statically
    generate the SVGs but let's keep the source files in tree so we can
    modify the diagrams whenever we want, provided blockdiag exists in
    a foreseenable future :-)

    Closes-Bug: #2026345

    Change-Id: I1cc078554ab149a9849c895e08c878180b7510b0

Changed in nova:
status: In Progress → Fix Released
Changed in ironic:
status: Confirmed → In Progress
Changed in ironic:
assignee: nobody → Mahnoor Asghar (mahnoorasghar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.opendev.org/c/openstack/ironic/+/906825
Committed: https://opendev.org/openstack/ironic/commit/7705b0b2d6dcc5a738932513d5d62dbf69e860c7
Submitter: "Zuul (22348)"
Branch: master

commit 7705b0b2d6dcc5a738932513d5d62dbf69e860c7
Author: Mahnoor Asghar <email address hidden>
Date: Fri Jan 26 13:14:36 2024 +0100

    Remove the sphinxcontrib-seqdiag dependency

    Remove the sphinxcontrib-seqdiag dependency as the Pillow upgrade to
    version 10.x (from OpenStack upper constraints) breaks its usage.
    In the ironic source docs, reference the svg files in the rst files,
    and keep the .diag files in the doc/source/images/ directory as backup.

    Closes-Bug: #2026345
    Change-Id: I54cea22e963441b729d4201ad9f8a055a65b54f8

Changed in ironic:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic 24.0.0

This issue was fixed in the openstack/ironic 24.0.0 release.

Revision history for this message
Alfredo Moralejo (amoralej) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 29.0.0.0rc1

This issue was fixed in the openstack/nova 29.0.0.0rc1 release candidate.

David Wilde (dave-wilde)
Changed in keystone:
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.