<div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 17, 2022 at 7:37 AM melanie witt <<a href="mailto:melwittt@gmail.com">melwittt@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I had tried to send this earlier with devstack output attached without <br>
thinking about the large size of the text. Sorry :(<br>
<br>
On Thu Jun 16 2022 16:56:21 GMT-0700 (Pacific Daylight Time), Dan Smith <br>
<<a href="mailto:dms@danplanet.com" target="_blank">dms@danplanet.com</a>> wrote:<br>
>> It looks like copies of this may be getting repeatedly concatenated<br>
>> into the plugin variable:<br>
>><br>
>> <a href="https://opendev.org/openstack/devstack/src/commit/44d07f300150f7297773a215031ea85cb1f5e205/lib/databases/mysql#L231" rel="noreferrer" target="_blank">https://opendev.org/openstack/devstack/src/commit/44d07f300150f7297773a215031ea85cb1f5e205/lib/databases/mysql#L231</a><br>
> <br>
> I don't think that's actually happening. If it was, restarting glance<br>
> wouldn't help (as Melanie indicated) and it also should never really<br>
> work. I was thinking that was more likely an artifact of the error<br>
> message or something. Looking at the config files, they seem right. For<br>
> example:<br>
> <br>
> <a href="https://zuul.opendev.org/t/openstack/build/ff5a7a6fc87840579b102b244f28200f/log/controller/logs/etc/glance/glance-api_conf.txt#21" rel="noreferrer" target="_blank">https://zuul.opendev.org/t/openstack/build/ff5a7a6fc87840579b102b244f28200f/log/controller/logs/etc/glance/glance-api_conf.txt#21</a><br>
<br>
I didn't notice this before but before things error with glance, other <br>
projects had no problem loading the dbcounter plugin, keystone-manage:<br>
<br>
> +lib/keystone:init_keystone:484            /usr/local/bin/keystone-manage --config-file /etc/keystone/keystone.conf db_sync<br>
> INFO dbcounter [-] Registered counter for database keystone<br>
> DEBUG oslo_db.sqlalchemy.engines [-] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_ENGINE_SUBSTITUTION {{(pid=371448) _check_effective_sql_mode /usr/local/lib/python3.8/dist-packages/oslo_db/sqlalchemy/engines.py:314}}<br>
> DEBUG dbcounter [-] [371448] Writer thread running {{(pid=371448) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}<br>
<br>
Yet glance fails to load it during two separate glance-manage calls:<br>
<br>
> +lib/glance:init_glance:489                /usr/local/bin/glance-manage --config-file /etc/glance/glance-api.conf db_sync<br>
> CRITICAL glance [-] Unhandled error: sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.plugins:dbcounterplugin=dbcounterplugin=dbcounter<br>
[...]<br>
> +lib/glance:init_glance:492                /usr/local/bin/glance-manage --config-file /etc/glance/glance-api.conf db_load_metadefs<br>
> CRITICAL glance [-] Unhandled error: sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.plugins:dbcounterplugin=dbcounterplugin=dbcounter<br>
<br>
Then cinder-manage loads it fine:<br>
<br>
> +lib/cinder:init_cinder:440                /usr/local/bin/cinder-manage --config-file /etc/cinder/cinder.conf db sync<br>
> INFO dbcounter [-] Registered counter for database cinder<br>
> DEBUG oslo_db.sqlalchemy.engines [-] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_ENGINE_SUBSTITUTION {{(pid=391785) _check_effective_sql_mode /usr/local/lib/python3.8/dist-packages/oslo_db/sqlalchemy/engines.py:314}}<br>
> DEBUG dbcounter [-] [391785] Writer thread running {{(pid=391785) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}<br>
<br>
Then nova-manage:<br>
<br>
> +lib/nova:init_nova:843                    /usr/local/bin/nova-manage --config-file /etc/nova/nova.conf api_db sync<br>
> Modules with known eventlet monkey patching issues were imported prior to eventlet monkey patching: urllib3. This warning can usually be ignored if the caller is only importing and not executing nova code.<br>
> INFO dbcounter [-] Registered counter for database nova_api<br>
> DEBUG dbcounter [-] [394510] Writer thread running {{(pid=394510) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}<br>
[...]<br>
> INFO dbcounter [-] Registered counter for database nova_cell0<br>
> DEBUG dbcounter [-] [394520] Writer thread running {{(pid=394520) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}<br>
[...]<br>
> INFO dbcounter [-] Registered counter for database nova_cell1<br>
> DEBUG dbcounter [-] [394531] Writer thread running {{(pid=394531) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}<br>
<br>
Finally glance fails to load the plugin in the g-api service when an <br>
image upload is requested:<br>
<br>
> +functions:_upload_image:121               openstack --os-cloud=devstack-admin --os-region-name=RegionOne image create cirros-0.5.2-x86_64-disk --public --container-format bare --disk-format qcow2 --property hw_rng_model=virtio<br>
> /usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead<br>
>   from cryptography.utils import int_from_bytes<br>
> /usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead<br>
>   from cryptography.utils import int_from_bytes<br>
> HttpException: 500: Server Error for url: <a href="http://192.168.42.11/image/v2/images" rel="noreferrer" target="_blank">http://192.168.42.11/image/v2/images</a>, The server has either erred or is incapable of performing the requested operation.: 500 Internal Server Error<br>
<br>
With this ^ I realized that restarting g-api might not have been a good <br>
indicator of anything resolving because in this example the plugin load <br>
failure occurs while checking quota for an inbound request. I'm not sure <br>
whether services load the dbcounter passively when they start or if it's <br>
only when database accesses are initiated.<br>
<br>
I also don't understand how or why one project can't load the plugin but <br>
the rest can. And I wonder whether it's a coincidence that it was glance <br>
in the two examples we have so far.<br>
<br>
-melwitt<br>
<br></blockquote><div><span class="gmail_default" style="font-family:verdana,sans-serif">I was hitting with the same error but as a workaround so far Dan (Smith) suggested a re-stack with "MYSQL_GATHER_PERFORMANCE=False" and it worked.</span></div><div style="font-family:verdana,sans-serif" class="gmail_default">This setting will avoid trying to load that plugin</div><div style="font-family:verdana,sans-serif" class="gmail_default"><br></div><div style="font-family:verdana,sans-serif" class="gmail_default">- abhishekk<br></div></div></div>