Skip to content

Issue with automatic migrations and infinite loop #3209

Closed

Description

@emaalouf

Hi there,

I really like this tool, it’s been great overall. However, I’ve run into an issue where it occasionally tries to run its own migrations even though I’ve specified not to. It’s not a big deal since I can usually stop it by closing the tool or changing the database credentials in the .env file.

The problem is that when it does attempt a migration and fails, it gets stuck in an endless loop, and the Esc key no longer works. I end up having to force-quit the entire application.

In versions prior to v15.0.0, I used to be able to queue a simple “hi” command to break out of the loop, but that doesn’t seem to work anymore.

Could you please help with this? It’s becoming a tricky issue, especially when the thread grows large.

Thanks,
Elias

Activity

  1. rekram1-node commented on Oct 16, 2025

    @rekram1-node
    Contributor

    @emaalouf what's the last version you were on? I think the last time migrations were done was quite a while ago...

    Can you show me what you see if you do:

    opencode run hello --print-logs

  2. self-assigned this
    on Oct 16, 2025
  3. emaalouf commented on Oct 16, 2025

    @emaalouf
    Author

    opencode run hello --print-logs

    INFO 2025-10-16T20:24:05 +59ms service=default version=0.15.3 args=["run","hello","--print-logs"] opencode
    INFO 2025-10-16T20:24:05 +46ms service=config path=/Users/.config/opencode/config.json loading
    INFO 2025-10-16T20:24:05 +1ms service=config path=/Users/.config/opencode/opencode.json loading
    INFO 2025-10-16T20:24:05 +0ms service=config path=/Users/.config/opencode/opencode.jsonc loading
    INFO 2025-10-16T20:24:05 +1ms service=bun cmd=["/opt/homebrew/Cellar/opencode/0.15.3/bin/opencode","add","@opencode-ai/plugin@0.15.3","--exact"] cwd=/Users/.config/opencode running
    INFO 2025-10-16T20:24:05 +1ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
    INFO 2025-10-16T20:24:05 +2ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
    INFO 2025-10-16T20:24:05 +22ms service=bus type=* subscribing
    INFO 2025-10-16T20:24:05 +0ms service=bus type=session.updated subscribing
    INFO 2025-10-16T20:24:05 +0ms service=bus type=message.updated subscribing
    INFO 2025-10-16T20:24:05 +0ms service=bus type=message.part.updated subscribing
    INFO 2025-10-16T20:24:05 +0ms service=format init
    INFO 2025-10-16T20:24:05 +0ms service=bus type=file.edited subscribing
    INFO 2025-10-16T20:24:05 +2ms service=session id=ses_6114e5321ffeBEcvBRPvu32203 version=0.15.3 projectID=fa1e0a05de0073b11d8fa37ac16363f43a532ee5 directory=/Users/DesktopV0 title=New session - 2025-10-16T20:24:05.598Z time={"created":1760646245598,"updated":1760646245598} created
    INFO 2025-10-16T20:24:05 +2ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, jdtls enabled LSP servers
    INFO 2025-10-16T20:24:05 +0ms service=bus type=session.updated publishing
    INFO 2025-10-16T20:24:05 +2ms service=bun code=1 stdout= stderr=EACCES: Permission denied while opening "/Users/.config/opencode/package.json"
    note: package.json must be writable to add packages
    done
    ERROR 2025-10-16T20:24:05 +0ms service=default e=Command failed with exit code 1 rejection
    INFO 2025-10-16T20:24:05 +2ms service=bus type=message.part.updated subscribing
    INFO 2025-10-16T20:24:05 +0ms service=bus type=session.error subscribing
    INFO 2025-10-16T20:24:05 +1ms service=session.prompt session=ses_6114e5321ffeBEcvBRPvu32203 prompt
    INFO 2025-10-16T20:24:05 +3ms service=bus type=message.updated publishing
    INFO 2025-10-16T20:24:05 +1ms service=bus type=message.part.updated publishing
    INFO 2025-10-16T20:24:05 +1ms service=bus type=session.updated publishing
    INFO 2025-10-16T20:24:05 +3ms service=models.dev file={} refreshing
    INFO 2025-10-16T20:24:05 +1ms service=provider init
    INFO 2025-10-16T20:24:05 +1ms service=provider providerID=opencode found
    INFO 2025-10-16T20:24:05 +0ms service=provider providerID=chutes found
    INFO 2025-10-16T20:24:05 +0ms service=provider providerID=openrouter found
    INFO 2025-10-16T20:24:05 +0ms service=provider providerID=google found
    INFO 2025-10-16T20:24:05 +0ms service=provider providerID=anthropic found
    INFO 2025-10-16T20:24:05 +1ms service=provider providerID=anthropic modelID=claude-sonnet-4-5 getModel
    INFO 2025-10-16T20:24:05 +0ms service=provider status=started providerID=anthropic getSDK
    INFO 2025-10-16T20:24:05 +49ms service=provider status=completed duration=49 providerID=anthropic getSDK
    INFO 2025-10-16T20:24:05 +1ms service=provider providerID=anthropic modelID=claude-sonnet-4-5 found
    INFO 2025-10-16T20:24:05 +0ms service=session.prompt session=ses_6114e5321ffeBEcvBRPvu32203 sessionID=ses_6114e5321ffeBEcvBRPvu32203 locking
    INFO 2025-10-16T20:24:06 +566ms service=provider providerID=anthropic modelID=claude-3-5-haiku-20241022 getModel
    INFO 2025-10-16T20:24:06 +0ms service=provider status=started providerID=anthropic getSDK
    INFO 2025-10-16T20:24:06 +0ms service=provider status=completed duration=0 providerID=anthropic getSDK
    INFO 2025-10-16T20:24:06 +0ms service=bus type=message.updated publishing
    INFO 2025-10-16T20:24:06 +0ms service=provider providerID=anthropic modelID=claude-3-5-haiku-20241022 found
    INFO 2025-10-16T20:24:06 +4ms service=session.prompt session=ses_6114e5321ffeBEcvBRPvu32203 process
    INFO 2025-10-16T20:24:06 +2ms service=session.prompt session=ses_6114e5321ffeBEcvBRPvu32203 type=start part
    INFO 2025-10-16T20:24:06 +622ms service=server method=PUT path=/auth/anthropic request
    INFO 2025-10-16T20:24:06 +1ms service=server method=PUT path=/auth/anthropic request
    INFO 2025-10-16T20:24:06 +1ms service=server duration=2 response
    INFO 2025-10-16T20:24:06 +0ms service=server duration=1 response
    INFO 2025-10-16T20:24:08 +1389ms service=bus type=session.updated publishing

  4. rekram1-node commented on Oct 16, 2025

    @rekram1-node
    Contributor

    are u able to get any responses at all?

    Also howd you install? I wonder why u get:

    INFO 2025-10-16T20:24:05 +2ms service=bun code=1 stdout= stderr=EACCES: Permission denied while opening "/Users/.config/opencode/package.json"
    note: package.json must be writable to add packages
    done
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions