Postgres - locally run error

I’m about to run initial dbt setup across local instance of Postgres 18.

Having quite basic dbt init structure with one test table CARS

Doing dbt seed

brand,model,year
audi,q3,2014

Then dbt run gives me weird

warning: dbt0255: Cannot register databases or schemas in the remote. Adapter ‘postgres’ does not support metadata operations.
error: dbt1000: Failed to receive render result for model.jaffle_shop.bronze_cars

=============================================================================================================================================================================== Execution Summary ===============================================================================================================================================================================
Finished ‘run’ with 2 warnings and 1 error for target ‘dev’ [648ms]
Processed: 1 model
Summary: 1 total | 1 error

I’m quite sure I have all correct in Postgres installations and settings in my profile.yml

My Model SQL is simple as

SELECT * FROM {{ ref(‘raw_cars’) }}

What is correct way to refer or setup schemas for local Postgres instance? And what metadata is supposed to be in use for dbt-postgres adapter?

A few things come to mind here:

  1. Are you attempting to use dbt Fusion rather than dbt Core? Postgres is not supported yet by that tool to my knowledge.
  2. If you are using dbt core, make sure you have the dbt-postgres adapter installed.
  3. Is your seed file named raw_cars.csv to match your select statement?
  4. Does your user account have permissions to create schemas? If not, you will either need to enable that or modify the generate_schema_name macro to use the given schema you’ve added in the configuration, rather than a dynamically created schema. I know less about the Postgres Admin side, so there could be something else I’m missing here.

Regardless, some extra information from your project config would be useful to have, and perhaps your profiles.yml (minus any sensitive info).

Hi.

Thank you for your answer.

I am definetly running on dbt-fusion as it’s recent installation that quite hard to custom somehow from dbt prospective.

So when I install dbt-core in my Python env and then run I see output as dbt-fusion.

The question now is how to run it not on it :slight_smile:

I’m degrading my installation packages down to 1.9 and 1.8 and it still saying the same running on Fusion.

Should I go deeper to End of Life versions then?

1 Like

Ok, I found in quite hidden docs that Postgres is supported only from python 3.13 as well.

I have done a pretty much job to cleanup all older versions on my mac and upgrade it properly.

Then reinstall from scratch all dbt-core by the official guide and end up with kind frustrating:

Warning: dbt-labs/dbt-cli/dbt 0.40.8 already installed
(dbt-env) XXX dbt % dbt --version
Traceback (most recent call last):
File “/Users/XXX/Projects/_edu/dbt/dbt-env/bin/dbt”, line 3, in
from dbt.cli.main import cli
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt/cli/init.py”, line 1, in
from .main import cli as dbt_cli # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt/cli/main.py”, line 11, in
from dbt.adapters.factory import register_adapter
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt/adapters/factory.py”, line 9, in
from dbt_common.events.functions import fire_event
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/events/init.py”, line 2, in
from dbt_common.events.event_manager_client import get_event_manager
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/events/event_manager_client.py”, line 5, in
from dbt_common.events.event_manager import IEventManager, EventManager
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/events/event_manager.py”, line 6, in
from dbt_common.events.logger import LoggerConfig, _Logger, _TextLogger, _JsonLogger, LineFormat
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/events/logger.py”, line 14, in
from dbt_common.utils.encoding import ForgivingJSONEncoder
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/utils/init.py”, line 9, in
from dbt_common.utils.dict import (
…<6 lines>…
)
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/utils/dict.py”, line 5, in
from dbt_common.exceptions import DbtConfigError, RecursionError
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/exceptions/init.py”, line 1, in
from dbt_common.exceptions.base import * # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/exceptions/base.py”, line 6, in
from dbt_common.dataclass_schema import ValidationError
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/dbt_common/dataclass_schema.py”, line 15, in
from mashumaro.jsonschema import build_json_schema
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/jsonschema/init.py”, line 1, in
from .builder import JSONSchemaBuilder, build_json_schema
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/jsonschema/builder.py”, line 5, in
from mashumaro.jsonschema.models import Context, JSONSchema
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/jsonschema/models.py”, line 178, in
class JSONObjectSchema(JSONSchema):
type: Optional[JSONSchemaInstanceType] = JSONSchemaInstanceType.OBJECT
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/mixins/dict.py”, line 25, in init_subclass
compile_mixin_unpacker(cls, **builder_params[“unpacker”])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/core/meta/mixin.py”, line 49, in compile_mixin_unpacker
builder.add_unpack_method()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/core/meta/code/builder.py”, line 586, in add_unpack_method
self._add_unpack_method_lines(method_name)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/core/meta/code/builder.py”, line 491, in _add_unpack_method_lines
).build(
~~~~~^
fname=fname,
^^^^^^^^^^^^
…<2 lines>…
alias=alias,
^^^^^^^^^^^^
)
^
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/core/meta/code/builder.py”, line 1332, in build
unpacked_value = UnpackerRegistry.get(
ValueSpec(
…<8 lines>…
)
)
File “/Users/XXX/Projects/_edu/dbt/dbt-env/lib/python3.14/site-packages/mashumaro/core/meta/types/common.py”, line 241, in get
raise UnserializableField(
spec.field_ctx.name, spec.type, spec.builder.cls
)
mashumaro.exceptions.UnserializableField: Field “schema” of type Optional[str] in JSONObjectSchema is not serializable

1 Like

Another detail to keep in mind here: if you are using VSCode, you also cannot use the dbt extension, as that relies on dbt fusion as well. I believe it also installs dbt fusion for you, which obviously is a problem. If you do have that, you’ll want to uninstall it.

The “Power User for dbt” extension that has been around a while does work for dbt core, though, even if it doesn’t have all the bells and whistles of the new dbt extension.

So, from there, I’d try the following:

  1. Assuming you are running your commands in a command-line, try which dbt and/or where dbt to try to see which dbt installation is getting run and where it is located. It may be that your global python environment has Fusion installed. You’ll want to take steps to remove it.
  2. Depending on how you set up your python environment, make sure it is active. Once you are sure, run dbt --version to see which is installed in the environment. Again, if it’s dbt fusion, you’ll want to remove it.
  3. Attempt to reinstall dbt-core (I ended up using the pip install with a virtual python environment) and see if you can get that to run

I hope some of that is helpful!

Thanks again, Ravenfollower.

I made a really deep dive in all of that and came up with the same outcome about VS plugin limitation and dbt Fusion supstitution. As I have posted I did all of these steps but seems had broken dbt framework installation constantly for me. As it seems like some more incompatibility in dbt core pythion libs.

Oh, I’m noticing something from your previous post:

Warning: dbt-labs/dbt-cli/dbt 0.40.8 already installed

That version number rings a bell for me as the current dbt Cloud CLI version. Maybe you installed that rather than dbt-core by accident?

Give these a try in your python environment:

pip list # (see all installed packages, then remove any that are "dbt" related)
pip uninstall dbt # and any other packages that are suspect

pip install dbt-core dbt-postgres # reinstall the ones you want

Also, I remember running into issues similar to yours a little while back when I tried installing dbt Fusion, and I think removing all the dbt-related packages helped before a reinstall.

You could also try just creating a new python virtual environment and scrapping the old one.

Hi Ravenfollower.

Thanks for the input. As far as I’m doing everything using Virtual Environments I don’t see it as a case.

But what I suspect now is that dbt Core packages are not clean enough to run independently without dbt-CLI that is in error. Seems like dbt as company force users to use their ‘ Cloud’ versions :slight_smile:

So, what I have from a scratch now is as simple as:

>>> pip3 install dbt-core

>>> dbt --version
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.14/bin/dbt”, line 3, in
from dbt.cli.main import cli
File “/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/dbt/cli/init.py”, line 1, in
from .main import cli as dbt_cli # noqa

…… Etc.. etc.. Stacktrace is the same as above

I’m sorry I wasn’t able to help you get to a working point again!

If you do figure it out, sharing your findings will definitely be helpful for others!

So, just for records I got figured out the solution for the issue but not the roots those somewhere in between Python installations and how VENV does its job.

The workaround solution in my case was to from recommended venv lib to pyenv.

So what I did in key commands were:

sqlbrew install pyenv  

export PATH="$HOME/.pyenv/bin:$PATH" 
eval "$(pyenv init --path)"    
eval "$(pyenv virtualenv-init -)"       
pyenv install 3.13.0    
~/.pyenv/versions/3.13.0/bin/python -m venv dbt-core-venv
source dbt-core-venv/bin/activate    
pip install dbt-core   
pip install dbt-postgres 

After that all dbt-core started to be functioning with no issue.