sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.56k stars 71 forks source link

[idea 2020.1.1] Unable to connect to Sourcery executable: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed #45

Closed Bryant-Yang closed 4 years ago

Bryant-Yang commented 4 years ago

Issue description or question

open a flask python project, after some indexing of the ide, the event log keep popping this message:

11:36 Unable to connect to Sourcery executable: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed

11:37 Unable to connect to Sourcery executable

11:38 Unable to connect to Sourcery executable ...

The first message tell a jsonrpc exception, then others take place on every minute.

Sourcery Version

0.3.5

Code editor or IDE name and version

Idea 2020.1.1 with python plugin

OS name and version

OSX 10.15.4

Bryant-Yang commented 4 years ago

I tried to delete the .idea folder in project, and reopen the project, the issue becomes as following:

Unable to connect to Sourcery executable (sqlite3.OperationalError) table refactoring has no column named vcs [SQL: INSERT INTO refactoring (plugin, plugin_version, version_number, status, max_iterations, vcs, remote_url, module_path, scope, source_hash, proposals_hash, source_cost, refactored_cost, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ] [parameters: ('IU-201.7223.91', '0.3.5', '0.6.8', 'UNCHANGED', 100, 'git', '...', '...', '...', 761330681220497371, 0, 0.5268593508060684, 0.5268593508060684, datetime.datetime(2020, 5, 14, 4, 10, 39, 970235, tzinfo=datetime.timezone.utc), datetime.datetime(2020, 5, 14, 4, 10, 39, 970235, tzinfo=datetime.timezone.utc))] (Background on this error at: http://sqlalche.me... (show balloon)

Hellebore commented 4 years ago

Thanks for the report, and apologies for the issue.

On mac we have a config file that we store in ~/Library/Application Support/sourcery, and it looks like the update to 0.3.5 has gone wrong in some cases and corrupted it.

Could you try deleting the contents of that directory and restarting pycharm?

Bryant-Yang commented 4 years ago

@Hellebore Thanks, works fine after deleting ~/Library/Application Support/sourcery/sourcery.db

Hellebore commented 4 years ago

Cool. We'll be releasing an update shortly that stops it happening again as well.