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

Killling saved connections #20759

Closed
altermodus opened this issue Aug 1, 2023 · 5 comments · Fixed by #20846
Closed

Killling saved connections #20759

altermodus opened this issue Aug 1, 2023 · 5 comments · Fixed by #20846
Assignees
Labels
bug sp:3 xf:navigator xf:sql editor SQL Editor and Editor Services like autocompletion, highlighting, folding, formatting, etc. xp:major
Milestone

Comments

@altermodus
Copy link

altermodus commented Aug 1, 2023

Description

All my database connections list is lost!

... after replace , to DEFAULT NULL, in sql script editor.

DBeaver Version

23.1.3

Operating System

Ubuntu 22.10

Database and driver

Any driver (tested on MariaDB, PostgreSQL)

Steps to reproduce

  1. Create and save any connection on Database tab
  2. Open database and open Script editor for opened database and print ,
  3. Press Ctrl+H, press "Replace ..."
  4. Replace , to DEFAULT NULL, and press OK

and i get an exception:

com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 18 path $..Mydb

Reason:
com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 18 path $..Mydb

Restart Dbeaver and I get and exception:

com.google.gson.stream.MalformedJsonException: Unterminated object at line 2 column 17 path $.

Reason:
com.google.gson.stream.MalformedJsonException: Unterminated object at line 2 column 17 path $.

Additional context

No response

@E1izabeth
Copy link
Member

Thank you for bug report.

We had something similar some time ago, but couldn't reproduce #20065

I can reproduce it now.

@E1izabeth E1izabeth added xp:major xf:navigator xf:sql editor SQL Editor and Editor Services like autocompletion, highlighting, folding, formatting, etc. and removed wait for review labels Aug 1, 2023
@E1izabeth
Copy link
Member

This suggestion should help to eliminate the error message and restore your connections #20065 (comment)

@altermodus
Copy link
Author

I found backup json files in

.local/share/DBeaverData/workspace6/General/.dbeaver/.data-sources.json.bak
.local/share/DBeaverData/workspace6/General/.dbeaver/.credetials-config.json.bak
.local/share/DBeaverData/workspace6/General/.dbeaver/.project-metadata.json.bak

and restore (rename) to

.local/share/DBeaverData/workspace6/General/.dbeaver/data-sources.json
.local/share/DBeaverData/workspace6/General/.dbeaver/credetials-config.json
.local/share/DBeaverData/workspace6/General/.dbeaver/project-metadata.json

but in data-sources.json I was found

    "folders": {
        "Folder1": {}default null DEFAULT NULL DEFAULT NULL,
        "Folder2": {}default null DEFAULT NULL DEFAULT NULL,
        "Folder3": {}default null DEFAULT NULL DEFAULT NULL,
        "Folder4": {}default null DEFAULT NULL DEFAULT NULL,
        "prod": {
            "parent": "Folder5"
...

(and project-metadata.json)

DBeaver was replace text in json files instead SQL editor.

I fix project-metadata.json and data-sources.json files and my DBeaver start correctly.

I became interested in the problem. DBeaver working correctly, but...

Ctrl+H - open Search window and designed for searching in files instead SQL editor.
I should press Ctrl+F instead Ctrl+H

I am sorry :)

But DBeaver should be protect own configuration files from user. I think.

Thanks.

@E1izabeth
Copy link
Member

We inherit this dialog from Eclipse platform, but we didn't expect such issue. It definitely shouldn't touch any files like data-sources.json. And I would expect that the dialog called from SQL Editor context would perform replacements only in the current SQL Editor.

@E1izabeth
Copy link
Member

We want to restrict places where the files are searched. .dbeaver should not be included there.

@E1izabeth E1izabeth added this to the 23.1.5 milestone Aug 2, 2023
@arhayka arhayka added the sp:3 label Aug 7, 2023
Destrolaric added a commit that referenced this issue Aug 9, 2023
Destrolaric added a commit that referenced this issue Aug 9, 2023
Destrolaric added a commit that referenced this issue Aug 9, 2023
@Matvey16 Matvey16 self-assigned this Aug 9, 2023
Destrolaric added a commit that referenced this issue Aug 14, 2023
Destrolaric added a commit that referenced this issue Aug 14, 2023
Destrolaric added a commit that referenced this issue Aug 14, 2023
serge-rider pushed a commit that referenced this issue Aug 15, 2023
* #20759 mark .dbeaver as hidden

* #20759 code cleanup

* #20759 update comments

* dbeaver/pro#1823 move to LocalProjectImpl

* #20759 hide additional files

* #20759 remove accidental changes

---------

Co-authored-by: Elizabeth <e1izabeth.k@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sp:3 xf:navigator xf:sql editor SQL Editor and Editor Services like autocompletion, highlighting, folding, formatting, etc. xp:major
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants