Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal server error - dmypy daemon crashed #18396

Open
arthurbrenno opened this issue Dec 31, 2024 · 8 comments
Open

internal server error - dmypy daemon crashed #18396

arthurbrenno opened this issue Dec 31, 2024 · 8 comments
Labels
bug mypy got something wrong

Comments

@arthurbrenno
Copy link

Bug Report

./src/intellibricks/models/supervised/engines.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.14.1
Daemon crashed!
Traceback (most recent call last):
File "mypy/dmypy_server.py", line 236, in serve
File "mypy/dmypy_server.py", line 285, in run_command
File "mypy/dmypy_server.py", line 353, in cmd_run
File "mypy/dmypy_server.py", line 432, in check
File "mypy/dmypy_server.py", line 700, in fine_grained_increment_follow_imports
File "mypy/server/update.py", line 285, in update
File "mypy/server/update.py", line 881, in propagate_changes_using_dependencies
File "mypy/server/update.py", line 1010, in reprocess_nodes
File "mypy/semanal_main.py", line 137, in semantic_analysis_for_targets
File "mypy/semanal_main.py", line 220, in process_top_levels
File "mypy/semanal_main.py", line 351, in semantic_analyze_target
File "mypy/semanal.py", line 646, in refresh_partial
File "mypy/semanal.py", line 657, in refresh_top_level
File "mypy/semanal.py", line 7288, in accept
File "mypy/errors.py", line 1288, in report_internal_error
File "mypy/semanal.py", line 7286, in accept
File "mypy/nodes.py", line 471, in accept
File "mypy/semanal.py", line 2958, in visit_import_from
File "mypy/semanal.py", line 3054, in report_missing_module_attribute
File "mypy/semanal.py", line 7267, in fail
File "mypy/errors.py", line 463, in report
File "mypy/errors.py", line 529, in add_error_info
File "mypy/errors.py", line 466, in _add_error_info
AssertionError

[35] Error running mypy in /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks: the mypy daemon crashed. This is probably a bug in mypy itself, see Output panel for details. The daemon will be restarted automatically.

To Reproduce

uv python install 3.13.1
uv python pin 3.13.1
uv venv
source .venv/bin/activate
uv add mypy --dev
dmypy start
x: str = 2
y: int = "3"
# ERROR

Your Environment

  • Mypy version used: 1.14.1
  • Mypy command-line flags: uv run dmypy start
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.13.1
@arthurbrenno arthurbrenno added the bug mypy got something wrong label Dec 31, 2024
@A5rocks
Copy link
Contributor

A5rocks commented Dec 31, 2024

Are you sure that's the right file? The traceback says that it crashed visiting an import from: File "mypy/semanal.py", line 2958, in visit_import_from.

@hauntsaninja
Copy link
Collaborator

Yeah, the traceback suggests ./src/intellibricks/models/supervised/engines.py

@arthurbrenno
Copy link
Author

arthurbrenno commented Dec 31, 2024

Hi. supervised/engines.py does not exist anymore. I deleted it. Maybe I clear mypy cache?

@arthurbrenno
Copy link
Author

arthurbrenno commented Dec 31, 2024

Are you sure that's the right file? The traceback says that it crashed visiting an import from: File "mypy/semanal.py", line 2958, in visit_import_from.

I'm sure! Also, I'm using the mypy extension, from Matan Gover. That might not be your problem, right? I should tell the extension author. The error I told you happens automatically. I didn't run any mypy command. The extension is running mypy daemon in the background. I tested now in a file called schema.py.

Just replicated the error again now:
Document saved: /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/src/intellibricks/llms/schema.py
[62] Check folder: /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks
[62] Received Python path from Python extension: /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/bin/python
[62] Running dmypy in folder /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks
/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/bin/dmypy --status-file '/Users/arthurbrenno/Library/Application Support/Code/User/workspaceStorage/8a9c88162dc1465d3ab80eb67813bccb/matangover.mypy/dmypy-8472a25bb76665ac15378ffb435fc2ea45288337-1975.json' run --log-file '/Users/arthurbrenno/Library/Application Support/Code/User/workspaceStorage/8a9c88162dc1465d3ab80eb67813bccb/matangover.mypy/dmypy-8472a25bb76665ac15378ffb435fc2ea45288337.log' -- --python-executable /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/bin/python . --show-error-end --no-error-summary --no-pretty --no-color-output
[62] stderr:
Daemon crashed!
Traceback (most recent call last):
File "mypy/dmypy_server.py", line 236, in serve
File "mypy/dmypy_server.py", line 285, in run_command
File "mypy/dmypy_server.py", line 353, in cmd_run
File "mypy/dmypy_server.py", line 432, in check
File "mypy/dmypy_server.py", line 700, in fine_grained_increment_follow_imports
File "mypy/server/update.py", line 285, in update
File "mypy/server/update.py", line 881, in propagate_changes_using_dependencies
File "mypy/server/update.py", line 1025, in reprocess_nodes
File "mypy/checker.py", line 535, in check_second_pass
File "mypy/checker.py", line 540, in check_partial
File "mypy/checker.py", line 555, in check_top_level
File "mypy/nodes.py", line 1364, in accept
File "mypy/checker.py", line 3001, in visit_assignment_stmt
File "mypy/checker.py", line 3179, in check_assignment
File "mypy/checker.py", line 4379, in check_simple_assignment
File "mypy/checker.py", line 7007, in check_subtype
File "mypy/checker.py", line 7350, in fail
File "mypy/messages.py", line 289, in fail
File "mypy/messages.py", line 264, in report
File "mypy/errors.py", line 463, in report
File "mypy/errors.py", line 529, in add_error_info
File "mypy/errors.py", line 466, in _add_error_info
AssertionError

[62] Error running mypy in /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks: the mypy daemon crashed. This is probably a bug in mypy itself, see Output panel for details. The daemon will be restarted automatically.

Idk where to look honestly

@A5rocks
Copy link
Contributor

A5rocks commented Dec 31, 2024

The traceback is different now (and is plausible on the repro you gave), so that's good! I'm not sure why it's happening since I'm not familiar with mypyd :/

@miky-rola
Copy link

Hi, I wanted to know whether this bug has been fixed.

@A5rocks
Copy link
Contributor

A5rocks commented Jan 2, 2025

It is unlikely this bug has been fixed. You can always install mypy via pip install git+https://github.com/python/mypy to check.

@arthurbrenno
Copy link
Author

Just reproduced the error again, more details below:

Daemon crashed!
Traceback (most recent call last):
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 237, in serve
    resp = self.run_command(command, data)
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 286, in run_command
    ret = method(self, **data)
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 354, in cmd_run
    return self.check(sources, export_types, is_tty, terminal_width)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 433, in check
    messages = self.fine_grained_increment_follow_imports(
        sources, explicit_export_types=export_types
    )
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 701, in fine_grained_increment_follow_imports
    messages = fine_grained_manager.update([], to_delete)
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/server/update.py", line 286, in update
    changed_modules = propagate_changes_using_dependencies(
        self.manager,
    ...<5 lines>...
        self.processed_targets,
    )
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/server/update.py", line 882, in propagate_changes_using_dependencies
    triggered |= reprocess_nodes(manager, graph, id, nodes, deps, processed_targets)
                 ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/server/update.py", line 1011, in reprocess_nodes
    semantic_analysis_for_targets(graph[module_id], nodes, graph, saved_attrs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal_main.py", line 137, in semantic_analysis_for_targets
    process_top_levels(graph, [state.id], patches)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal_main.py", line 220, in process_top_levels
    deferred, incomplete, progress = semantic_analyze_target(
                                     ~~~~~~~~~~~~~~~~~~~~~~~^
        next_id, next_id, state, state.tree, None, final_iteration, patches
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal_main.py", line 351, in semantic_analyze_target
    analyzer.refresh_partial(
    ~~~~~~~~~~~~~~~~~~~~~~~~^
        refresh_node,
        ^^^^^^^^^^^^^
    ...<4 lines>...
        active_type=active_type,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 647, in refresh_partial
    self.refresh_top_level(node)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 658, in refresh_top_level
    self.accept(d)
    ~~~~~~~~~~~^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7303, in accept
    report_internal_error(err, self.errors.file, node.line, self.errors, self.options)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 1289, in report_internal_error
    raise err
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7301, in accept
    node.accept(self)
    ~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1183, in accept
    return visitor.visit_class_def(self)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 1788, in visit_class_def
    self.analyze_class(defn)
    ~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 1929, in analyze_class
    bases, tvar_defs, is_protocol = self.clean_up_bases_and_infer_type_variables(
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        defn, bases, context=defn
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 2240, in clean_up_bases_and_infer_type_variables
    self.analyze_type_expr(base_expr)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7355, in analyze_type_expr
    expr.accept(self)
    ~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1895, in accept
    return visitor.visit_member_expr(self)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 5906, in visit_member_expr
    base.accept(self)
    ~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1873, in accept
    return visitor.visit_name_expr(self)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 5651, in visit_name_expr
    n = self.lookup(expr.name, expr)
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 6345, in lookup
    self.name_not_defined(name, ctx)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7176, in name_not_defined
    self.fail(message, ctx, code=codes.NAME_DEFINED)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7282, in fail
    self.errors.report(ctx.line, ctx.column, msg, blocker=blocker, code=code)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 464, in report
    self.add_error_info(info)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 530, in add_error_info
    self._add_error_info(file, info)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 467, in _add_error_info
    assert file not in self.flushed_files
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError


[34] Error running mypy in /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks: the mypy daemon crashed. This is probably a bug in mypy itself, see Output panel for details. The daemon will be restarted automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

4 participants