# Warning about SQL

**URL:** <https://aiida.discourse.group/t/warning-about-sql/593>\
**Category:** General Usage\
**Created:** [March 28, 2025, 10:38am UTC](https://aiida.discourse.group/t/warning-about-sql/593 "2025-03-28T10:38:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsavva](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/gsavva/32/289_2.png) [@gsavva](https://aiida.discourse.group/u/gsavva)\
**Post date:** [March 28, 2025, 10:38am UTC](https://aiida.discourse.group/t/warning-about-sql/593/1 "2025-03-28T10:38:31Z")

</div>

Hi aiida team,  
after updating `aiida-quantumespresso` to 4.9.0 and `aiida-core` to 2.6.3, I’ve been getting the following warnings:

```auto
/home/anaconda3/envs/aiida/lib/python3.9/site-packages/aiida/storage/psql_dos/orm/utils.py:84: SAWarning: Object of type <DbNode> not in session, add operation along 'DbUser.dbnodes' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation. Consider using ``no_autoflush`` context manager if this warning happended while initializing objects.)
  return getattr(self._model, item)
/home/anaconda3/envs/aiida/lib/python3.9/site-packages/aiida/storage/psql_dos/orm/querybuilder/main.py:182: SAWarning: Object of type <DbNode> not in session, add operation along 'DbUser.dbnodes' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation. Consider using ``no_autoflush`` context manager if this warning happended while initializing objects.)
  result = build.query.count()

```

I found a similar question from May 2024 ([Strange warning about SQL](https://aiida.discourse.group/t/strange-warning-about-sql/402)). The answer suggests that the warning should have been suppressed, and given that I have the latest version of `aiida-core`, I was wondering if there is anything else going on.

Thanks for any hints you may provide!

---

<div class="post-metadata">

**Author:** ![mbercx](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/mbercx/32/345_2.png) [@mbercx](https://aiida.discourse.group/u/mbercx)\
**Post date:** [May 1, 2025, 12:44pm UTC](https://aiida.discourse.group/t/warning-about-sql/593/2 "2025-05-01T12:44:47Z")

</div>

Hi @gsavva, sorry for the slow reply. Indeed looking at the other topic and PR this _should_ have been fixed, and I haven’t run into the warnings anymore with the versions you specify. When do you see these warnings? When submitting work chains?

---

<div class="post-metadata">

**Author:** ![gsavva](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/gsavva/32/289_2.png) [@gsavva](https://aiida.discourse.group/u/gsavva)\
**Post date:** [May 14, 2025, 11:04am UTC](https://aiida.discourse.group/t/warning-about-sql/593/3 "2025-05-14T11:04:05Z")

</div>

Thanks @mbercx. yes, I saw these warnings when submitting workchains.

Eventually I had to downgrade `aiida-quantumespresso` from `4.9.0` to `4.6.0` ( but `aiida-core` remains in version 2.6.3) and the warnings disappear.

Might be useful to note, for reference, that my current `SQLAlchemy` version is 2.0.39.

---

<div class="post-metadata">

**Author:** ![mbercx](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/mbercx/32/345_2.png) [@mbercx](https://aiida.discourse.group/u/mbercx)\
**Post date:** [May 14, 2025, 11:25am UTC](https://aiida.discourse.group/t/warning-about-sql/593/4 "2025-05-14T11:25:05Z")

</div>

Hmm, strange. Which work chain are you running? Maybe I can try to reproduce the issue for `aiida-quantumespresso==4.9.0`.

---

<div class="post-metadata">

**Author:** ![gsavva](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/gsavva/32/289_2.png) [@gsavva](https://aiida.discourse.group/u/gsavva)\
**Post date:** [May 16, 2025, 9:32am UTC](https://aiida.discourse.group/t/warning-about-sql/593/5 "2025-05-16T09:32:43Z")

</div>

> Which work chain are you running?

PwBaseWorkChain
