Skip to content

[Bug] Resource names cannot contain spaces error does not provide guidance on where a space is present #11835

@sophiad96

Description

@sophiad96

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

A space is present in a file name in my repo and in dbt Studio, I see the error "Resource names cannot contain spaces" however there is no indication as to where the extra space is in my project. This only occurs on Latest (probably due to require_resource_names_without_spaces now being set to True by default). It's extremely difficult to get around this error not knowing where the space is, and therefore I am unable to develop in Studio entirely.

Expected Behavior

I would expect the error message to tell you which resource name has an extra space that is causing the failure. Example: "Resource names cannot contain spaces extra space found in {{model_file_name}}"

Steps To Reproduce

  1. Directly edit a file name in your git repo to include an extra space (example: ephemeral_model.sql --> ephemeral model.sql)
  2. Ensure Studio is running on Latest
  3. Load Studio and check out the branch that you added the space on, the error message will appear but will not tell you which file is the culprit (as can be seen in the log output below)

Relevant log output

21:16:47 Observability Metric: msgpack_manifest_bytes=665516.0
21:16:48 Unable to do partial parsing because of a version mismatch
21:16:48 Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '7f6fba00-00cf-45e7-9e14-2c7e276d5626', 'context': []}
21:16:49 Sending event: {'category': 'dbt', 'action': 'plugin_get_nodes', 'label': '7f6fba00-00cf-45e7-9e14-2c7e276d5626', 'context': []}
21:16:49 Sending event: {'category': 'dbt', 'action': 'plugin_get_nodes', 'label': '7f6fba00-00cf-45e7-9e14-2c7e276d5626', 'context': []}
21:16:49 Observability Metric: msgpack_manifest_bytes=673654.0
21:16:49 Encountered an error:
Runtime Error
  Resource names cannot contain spaces
21:16:49 Resource report: {"command_name": "parse", "command_success": false, "command_wall_clock_time": 4.3203025, "process_in_blocks": "0", "process_kernel_time": 2.936042, "process_mem_max_rss": "252852", "process_out_blocks": "70280", "process_user_time": 6.4514}
21:16:49 Observability Metric: command_success=0.0: Runtime Error
  Resource names cannot contain spaces
21:16:49 Observability Metric: command_wall_clock_time=4.320302486419678
21:16:49 Observability Metric: process_user_time=6.451399803161621
21:16:49 Observability Metric: process_kernel_time=2.936042070388794
21:16:49 Observability Metric: process_mem_max_rss=252852.0
21:16:49 Command `cli parse` failed at 21:16:49.642571 after 4.32 seconds
21:16:49 Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]}

Environment

- OS:
- Python:
- dbt: Latest

Which database adapter are you using with dbt?

snowflake

Additional Context

I reproduced this on Snowflake, but have seen this on Databricks as well and imagine it would impact users of any adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions