GithubHelp home page GithubHelp logo

bytebase / bytebase Goto Github PK

View Code? Open in Web Editor NEW
10.2K 83.0 661.0 970.36 MB

The GitHub/GitLab for database DevOps. World's most advanced database DevOps and CI/CD for Developer, DBA and Platform Engineering teams.

Home Page: https://www.bytebase.com

License: Other

HTML 7.73% JavaScript 0.06% Vue 19.45% CSS 0.17% TypeScript 26.74% Go 45.46% Dockerfile 0.03% Shell 0.07% PLpgSQL 0.26% Smarty 0.01% Python 0.01%
mysql sql tidb devops postgresql clickhouse snowflake gitlab cicd postgres sql-client mongodb oracle sqlserver schema-migrations redis gitops flyway liquibase terraform

bytebase's Issues

Can NOT create any schema update issue

Describe the bug

Can not create any schema update issue

Steps or screenshots to reproduce the behavior

fail to create an schema update issue

Additional context

It seems to caused by this PR #205

can't support create database for pg12.06

Provide the MySQL version you are using (if related with instance/database operation)

Provide the GitLab version you are using (if related with VCS integration)

Provide the Bytebase version you are using

The version info is shown on the bottom left of the console.

Describe the bug

A clear and concise description of what the bug is.

Steps or screenshots to reproduce the behavior

  1. Go to 'database'
  2. Click on 'create database'
  3. See error

Image_20220110112336

If the error is not obvious, you can enable the --debug option on startup and attach the console message here

Expected behavior

A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

Supporting new driver: Databend

Databend is promising serverless data warehouse that can be connected to as a clickhouse or mysql server.

It should not be very hard to add the integration.

I've tried it out with the existing clickhouse.Driver but it doesn't work now. I have filed an issue for the databend project.

Support for customized migration methods

Is your feature request related to a problem? Please describe.

Currently, Bytebase directly runs DDL to apply the schema change. However, this is risky for large tables due to the lock contention and intensive disk I/O etc.

For some large tables, the migration is usually done online with some 3rd party tools like PT-OSC to minimize the performance impact, and this is not supported yet.

Describe the solution you'd like

Support customized migration script so that users are allowed to use tools like PT-OSC.
Looks like it's feasible by abstracting the "driver" in schema update task executor.
https://github.com/bytebase/bytebase/blob/main/server/task_executor_schema_update.go#L151

Additional context

Add any other context or screenshots about the feature request here.

error massage: pq: CREATE DATABASE cannot run inside a transaction block

Discussed in #44

Originally posted by Shlpeng November 20, 2021
error massage: pq: CREATE DATABASE cannot run inside a transaction block

sql is : CREATE DATABASE "pg1120" ENCODING "UTF8"

bytebase env : docker run --init --name bytebase --restart always --publish 8080:8080 --volume ~/.bytebase/data:/var/opt/bytebase bytebase/bytebase:0.8.1 --data /var/opt/bytebase --host http://localhost --port 8080

pg env: docker run -it --name postgres --restart always -e POSTGRES_PASSWORD='Aa123456' -e ALLOW_IP_RANGE=0.0.0.0/0 -v /tmp/postgres/data:/var/lib/postgresql -p 55433:5432 -d postgres

error detail: 2021-11-20T04:53:34.617Z ERROR server/task.go:326 Failed to change task status. {"id": 105, "name": "Create database 'pg_db1120'", "old_status": "PENDING", "new_status": "RUNNING", "error": "failed to change task 105(Create database 'pg_db1120') status: database is locked"}
github.com/bytebase/bytebase/server.(*Server).ChangeTaskStatusWithPatch.func1
/backend-build/server/task.go:326
github.com/bytebase/bytebase/server.(*Server).ChangeTaskStatusWithPatch
/backend-build/server/task.go:350
github.com/bytebase/bytebase/server.(*Server).ChangeTaskStatus
/backend-build/server/task.go:320
github.com/bytebase/bytebase/server.(*TaskScheduler).ScheduleIfNeeded
/backend-build/server/task_scheduler.go:276
github.com/bytebase/bytebase/server.(*Server).ScheduleNextTaskIfNeeded
/backend-build/server/pipeline.go:65
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1.1
/backend-build/server/task_scheduler.go:77
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1
/backend-build/server/task_scheduler.go:211
2021-11-20T04:53:34.617Z ERROR server/task_scheduler.go:78 Failed to schedule next running task {"pipeline_id": 104, "error": "failed to change task 105(Create database 'pg_db1120') status: database is locked"}
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1.1
/backend-build/server/task_scheduler.go:78
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1
/backend-build/server/task_scheduler.go:211
sync schema error: failed to get tables from database "test1111": getTableColumns("test1111_02", "table_name") got error pq: relation "table_name" does not exist
2021-11-20T05:09:48.149Z ERROR server/anomaly_scanner.go:173 Failed to create anomaly {"instance": "MySQL Test (Follow the "External Link" field to bring up the MySQL server)", "type": "bb.anomaly.instance.connection", "error": "database is locked"}
github.com/bytebase/bytebase/server.(*AnomalyScanner).checkInstanceAnomaly
/backend-build/server/anomaly_scanner.go:173
github.com/bytebase/bytebase/server.(*AnomalyScanner).Run.func1.1.2
/backend-build/server/anomaly_scanner.go:121
github.com/bytebase/bytebase/server.(*AnomalyScanner).Run.func1.1
/backend-build/server/anomaly_scanner.go:137
github.com/bytebase/bytebase/server.(*AnomalyScanner).Run.func1
/backend-build/server/anomaly_scanner.go:142
2021-11-20T05:23:18.583Z ERROR server/task.go:326 Failed to change task status. {"id": 106, "name": "Create database 'db1120_03'", "old_status": "PENDING", "new_status": "RUNNING", "error": "failed to change task 106(Create database 'db1120_03') status: database is locked"}
github.com/bytebase/bytebase/server.(*Server).ChangeTaskStatusWithPatch.func1
/backend-build/server/task.go:326
github.com/bytebase/bytebase/server.(*Server).ChangeTaskStatusWithPatch
/backend-build/server/task.go:350
github.com/bytebase/bytebase/server.(*Server).ChangeTaskStatus
/backend-build/server/task.go:320
github.com/bytebase/bytebase/server.(*TaskScheduler).ScheduleIfNeeded
/backend-build/server/task_scheduler.go:276
github.com/bytebase/bytebase/server.(*Server).ScheduleNextTaskIfNeeded
/backend-build/server/pipeline.go:65
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1.1
/backend-build/server/task_scheduler.go:77
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1
/backend-build/server/task_scheduler.go:211
2021-11-20T05:23:18.583Z ERROR server/task_scheduler.go:78 Failed to schedule next running task {"pipeline_id": 105, "error": "failed to change task 106(Create database 'db1120_03') status: database is locked"}
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1.1
/backend-build/server/task_scheduler.go:78
github.com/bytebase/bytebase/server.(*TaskScheduler).Run.func1
/backend-build/server/task_scheduler.go:211

0.72 version docker 401 error

Hey! after running on admin create page I get the following error after press "Create admin account":
image
Log:
image

OS: windows10
Browser: GoogleChrome 95.0.4638.69

version: "3.8"
services:
  bytebase:
    image: bytebase/bytebase:${BYTEBASE_VERSION:-0.7.2}
    ports:
      - 0.0.0.0:8008:8008
    command: |
      --data /var/opt/bytebase  --port 8008 --host http://192.168.0.105 --debug

Full log:

bytebase_1  | -----Config BEGIN-----
bytebase_1  | mode=release
bytebase_1  | server=http://0.0.0.0:8008
bytebase_1  | frontend=http://0.0.0.0:8008
bytebase_1  | dsn=file:/var/opt/bytebase/bytebase.db
bytebase_1  | seedDir=seed/release
bytebase_1  | readonly=false
bytebase_1  | demo=false
bytebase_1  | debug=true
bytebase_1  | -----Config END-------
bytebase_1  | 2021-10-30T15:31:59.451Z  INFO    store/sqlite.go:218     Apply database migration if needed...
bytebase_1  | 2021-10-30T15:31:59.451Z  INFO    store/sqlite.go:225     Current schema version before migration: 0.0
bytebase_1  | 2021-10-30T15:31:59.452Z  INFO    store/sqlite.go:280     Migrating migration/10001__init_schema.sql...
bytebase_1  | 2021-10-30T15:31:59.555Z  INFO    store/sqlite.go:261     Current schema version after migration: 1.1
bytebase_1  | 2021-10-30T15:31:59.555Z  INFO    store/sqlite.go:273     Completed database migration.
bytebase_1  | 2021-10-30T15:31:59.557Z  INFO    store/sqlite.go:157     Seeding database from seed/release, force: false ...
bytebase_1  | 2021-10-30T15:31:59.557Z  INFO    store/sqlite.go:193     Seeding seed/release/10001__init_seed.sql...
bytebase_1  | 2021-10-30T15:31:59.566Z  INFO    store/sqlite.go:187     Completed database seeding.
bytebase_1  | 2021-10-30T15:31:59.574Z  DEBUG   server/server.go:231    All registered routes: [
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/environment/:id",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerEnvironmentRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/issue/:issueId/subscriber",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueSubscriberRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PROPFIND",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/principal",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPrincipalRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/instance",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database/:id/table/:tableName",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func6"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/activity",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerActivityRoutes.func1"
bytebase_1  |
bytebase_1  | ██████╗ ██╗   ██╗████████╗███████╗██████╗  █████╗ ███████╗███████╗
bytebase_1  | ██╔══██╗╚██╗ ██╔╝╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝
bytebase_1  | ██████╔╝ ╚████╔╝    ██║   █████╗  ██████╔╝███████║███████╗█████╗
bytebase_1  | ██╔══██╗  ╚██╔╝     ██║   ██╔══╝  ██╔══██╗██╔══██║╚════██║██╔══╝
bytebase_1  | ██████╔╝   ██║      ██║   ███████╗██████╔╝██║  ██║███████║███████╗
bytebase_1  | ╚═════╝    ╚═╝      ╚═╝   ╚══════╝╚═════╝ ╚═╝  ╚═╝╚══════╝╚══════╝
bytebase_1  |
bytebase_1  | Version 0.7.2 has started at http://0.0.0.0:8008
bytebase_1  | ___________________________________________________________________________________________
bytebase_1  |
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/bookmark/:bookmarkId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerBookmarkRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/auth/signup",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerAuthRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/project/:projectId/repository",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func5"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/inbox/:inboxId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInboxRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/sql/ping",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerSqlRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "REPORT",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/project",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/issue/:issueId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/database/:id/backupsetting",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func10"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/issue/:issueId/subscriber",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueSubscriberRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "TRACE",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/policy/environment/:environmentId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPolicyRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/project/:projectId/repository",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func8"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/instance/:instanceId/migration/history",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func9"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database/:id/table",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func5"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "HEAD",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/project/:projectId/member/:memberId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectMemberRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/instance/:instanceId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/instance/:instanceId/migration/history/:historyId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func8"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/setting",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerSettingRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/auth/logout",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerAuthRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/project/:projectId/webhook",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectWebhookRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/pipeline/:pipelineId/task/:taskId/status",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerTaskRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/project/:projectId/webhook",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectWebhookRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/issue/:issueId/status",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueRoutes.func5"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/bookmark",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerBookmarkRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/member/:id",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerMemberRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/project",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PROPFIND",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/database",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/sql/syncschema",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerSqlRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/vcs/:vcsId/repository",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerVCSRoutes.func6"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "CONNECT",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/principal/:principalId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPrincipalRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/environment/reorder",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerEnvironmentRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database/:id/backupsetting",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func11"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/inbox",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInboxRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "CONNECT",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/project/:projectId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database/:id",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/environment",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerEnvironmentRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/principal",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPrincipalRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/issue",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/activity/:activityId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerActivityRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/vcs/:vcsId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerVCSRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/plan",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPlanRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "OPTIONS",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/instance/:instanceId/user",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func5"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/project/:projectId/webhook/:webhookId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectWebhookRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/vcs",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerVCSRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/instance/:instanceId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/instance/:instanceId/migration",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func6"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/pipeline/:pipelineId/task/:taskId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerTaskRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/policy/environment/:environmentId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPolicyRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/project/:projectId/member/:memberId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectMemberRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "HEAD",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/setting/:name",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerSettingRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/auth/login",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerAuthRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/project/:projectId/member",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectMemberRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/instance/:instanceId/migration/status",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func7"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/assets/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.WrapHandler.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "TRACE",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "OPTIONS",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PUT",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/project/:projectId/webhook/:webhookId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectWebhookRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/actuator/info",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerActuatorRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/environment",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerEnvironmentRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/issue",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/pipeline/:pipelineId/task/:taskId/check",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerTaskRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/project/:projectId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/bookmark",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerBookmarkRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/instance",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInstanceRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/*",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.embedFrontend.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "REPORT",
bytebase_1  |     "path": "/api",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database/:id/backup",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func9"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/issue/:issueId/subscriber/:subscriberId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueSubscriberRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/activity",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerActivityRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/vcs/:vcsId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerVCSRoutes.func5"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/plan",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPlanRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/member",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerMemberRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/database/:id",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/database/:id/view",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func7"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PUT",
bytebase_1  |     "path": "/api/*",
bytebase_1  |     "name": "github.com/labstack/echo/v4.glob..func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "DELETE",
bytebase_1  |     "path": "/api/project/:projectId/webhook/:webhookId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectWebhookRoutes.func5"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/vcs/:vcsId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerVCSRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/hook/gitlab/:id",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerWebhookRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/member",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerMemberRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/project/:projectId/repository",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func7"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/issue/:issueId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerIssueRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/inbox/summary",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerInboxRoutes.func2"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/principal/:principalId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerPrincipalRoutes.func4"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "PATCH",
bytebase_1  |     "path": "/api/activity/:activityId",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerActivityRoutes.func3"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/vcs",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerVCSRoutes.func1"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/project/:projectId/repository",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectRoutes.func6"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "GET",
bytebase_1  |     "path": "/api/project/:projectId/webhook/:webhookId/test",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerProjectWebhookRoutes.func6"
bytebase_1  |   },
bytebase_1  |   {
bytebase_1  |     "method": "POST",
bytebase_1  |     "path": "/api/database/:id/backup",
bytebase_1  |     "name": "github.com/bytebase/bytebase/server.(*Server).registerDatabaseRoutes.func8"
bytebase_1  |   }
bytebase_1  | ]
bytebase_1  | 2021-10-30T15:31:59.574Z  DEBUG   server/anomaly_scanner.go:36    Anomaly scanner started and will run every 10m0s
bytebase_1  | 2021-10-30T15:31:59.574Z  DEBUG   server/anomaly_scanner.go:40    New anomaly scanner round started...
bytebase_1  | 2021-10-30T15:31:59.575Z  DEBUG   server/task_check_scheduler.go:37       Task check scheduler started and will run every 1s
bytebase_1  | 2021-10-30T15:31:59.580Z  DEBUG   server/anomaly_scanner.go:114   Scan instance anomaly   {"instance": "MySQL Test (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:31:59.580Z  DEBUG   mysql/mysql.go:90       Opening MySQL driver    {"dsn": "root:<<redacted password>>@tcp(host.docker.internal:3306)/?multiStatements=true", "environment": "Test", "database": "MySQL Test (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:31:59.582Z  DEBUG   server/schema_syncer.go:31      Schema syncer started and will run every 30m0s
bytebase_1  | 2021-10-30T15:31:59.582Z  DEBUG   server/schema_syncer.go:35      New schema syncer round started...
bytebase_1  | 2021-10-30T15:31:59.584Z  DEBUG   server/task_scheduler.go:37     Task scheduler started and will run every 1s
bytebase_1  | 2021-10-30T15:31:59.586Z  DEBUG   server/schema_syncer.go:76      Sync instance schema    {"instance": "MySQL Prod (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:31:59.586Z  DEBUG   mysql/mysql.go:90       Opening MySQL driver    {"dsn": "root:<<redacted password>>@tcp(host.docker.internal:3306)/?multiStatements=true", "environment": "Prod", "database": "MySQL Prod (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:31:59.586Z  DEBUG   server/backup_runner.go:34      Auto backup runner started and will run every 10m0s
bytebase_1  | 2021-10-30T15:31:59.586Z  DEBUG   server/backup_runner.go:38      New auto backup round started...
bytebase_1  | 2021-10-30T15:31:59.587Z  DEBUG   server/schema_syncer.go:76      Sync instance schema    {"instance": "MySQL Test (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:31:59.587Z  DEBUG   mysql/mysql.go:90       Opening MySQL driver    {"dsn": "root:<<redacted password>>@tcp(host.docker.internal:3306)/?multiStatements=true", "environment": "Test", "database": "MySQL Test (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:32:01.618Z  DEBUG   server/schema_syncer.go:84      Failed to sync instance {"id": 102, "name": "MySQL Prod (Follow the \"External Link\" field to bring up the MySQL server)", "error": "failed to connect database at host.docker.internal:3306 with user \"root\": dial tcp 192.168.65.2:3306: connect: connection refused"}
bytebase_1  | 2021-10-30T15:32:01.618Z  DEBUG   server/schema_syncer.go:84      Failed to sync instance {"id": 101, "name": "MySQL Test (Follow the \"External Link\" field to bring up the MySQL server)", "error": "failed to connect database at host.docker.internal:3306 with user \"root\": dial tcp 192.168.65.2:3306: connect: connection refused"}
bytebase_1  | 2021-10-30T15:32:02.621Z  DEBUG   server/anomaly_scanner.go:114   Scan instance anomaly   {"instance": "MySQL Prod (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | 2021-10-30T15:32:02.621Z  DEBUG   mysql/mysql.go:90       Opening MySQL driver    {"dsn": "root:<<redacted password>>@tcp(host.docker.internal:3306)/?multiStatements=true", "environment": "Prod", "database": "MySQL Prod (Follow the \"External Link\" field to bring up the MySQL server)"}
bytebase_1  | {"time":"2021-10-30T15:32:26Z","method":"GET","uri":"/api/plan","status":200,"error":""}
bytebase_1  | {"time":"2021-10-30T15:32:26Z","method":"GET","uri":"/api/actuator/info","status":200,"error":""}
bytebase_1  | {"time":"2021-10-30T15:32:33Z","method":"POST","uri":"/api/auth/signup","status":200,"error":""}
bytebase_1  | {"time":"2021-10-30T15:32:33Z","method":"GET","uri":"/api/principal/101","status":401,"error":"code=401, message=Missing access token"}

Instance broken after upgrade to 0.9.0

Provide the Bytebase version you are using
0.9.0

Describe the bug
After migrating from 0.8.1 to 0.9.0, I'm seeing errors in the bottom right corner:

  • failed to fetch project list
  • failed to fetch database list

I enabled debugging and see this in the output:

{"time":"2021-12-13T16:42:49Z","method":"GET","uri":"/api/project?user=101","status":500,"error":"code=500, message=Failed to fetch project list, internal=no such column: tenant_mode"}
{"time":"2021-12-13T16:44:31Z","method":"GET","uri":"/api/database","status":500,"error":"code=500, message=Failed to fetch database list, internal=no such column: tenant_mode"}

Additional context
I don't see anything about a tenant in the documentation, in the bytebase migration_history schema, or anywhere else. I saw mention of tenants in the changelog to version 0.9.0, but can't seem to find out where to go enable/disable that feature whatever that is.

Trying to get in touch regarding a security issue

Hey there!

I belong to an open source security research community, and a member (@0xAmal) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

Support ClickHouse database

Is your feature request related to a problem? Please describe.
Currently, we use CLI https://github.com/golang-migrate/migrate for clickhouse migration, sometimes we need UI based solution for database schema migration, I would like bytebase will support ClickHouse as a first-class citizen database

** Additional context **
Look to https://clickhouse.tech/docs/en/ ClickHouse is a blazing fast columnar database with sharding and replication, all ALTER TABLE operations are non-blocked

Error when using the docker install command.

Could you please add more detail on how to setup the mySql database?

`docker run --init --name bytebase --restart always --publish 8080:8080 --volume ~/.bytebase/data:/var/opt/bytebase bytebase/bytebase:0.1.0 --data /var/opt/bytebase --host http://localhost --port 8080

Unable to find image 'bytebase/bytebase:0.1.0' locally
0.1.0: Pulling from bytebase/bytebase
5843afab3874: Pull complete
0ebceee8c283: Pull complete
abf54fc4f08b: Pull complete
Digest: sha256:aad2c9bacfe8f36983c00e532fd540a27569f584d50a19b19e968521bdc6f49d
Status: Downloaded newer image for bytebase/bytebase:0.1.0
-----Config BEGIN-----
mode=release
host=http://localhost
port=8080
dsn=file:/var/opt/bytebase/bytebase.db
seedDir=seed/release
readonly=false
demo=false
debug=false
-----Config END-------
2021-07-12T05:43:54.720Z INFO store/sqlite.go:213 Apply database migration if needed...
2021-07-12T05:43:54.725Z INFO store/sqlite.go:220 Current schema version before migration: 0.0
2021-07-12T05:43:54.725Z INFO store/sqlite.go:270 Migrating migration/10001__init_schema.sql...
2021-07-12T05:43:54.795Z INFO store/sqlite.go:255 Current schema version after migration: 1.1
2021-07-12T05:43:54.795Z INFO store/sqlite.go:263 Completed database migration.
2021-07-12T05:43:54.803Z INFO store/sqlite.go:152 Seeding database from seed/release, force: false ...
2021-07-12T05:43:54.803Z INFO store/sqlite.go:188 Seeding seed/release/10001__init_seed.sql...
2021-07-12T05:43:54.838Z INFO store/sqlite.go:182 Completed database seeding.

██████╗ ██╗ ██╗████████╗███████╗██████╗ █████╗ ███████╗███████╗
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝
██████╔╝ ╚████╔╝ ██║ █████╗ ██████╔╝███████║███████╗█████╗
██╔══██╗ ╚██╔╝ ██║ ██╔══╝ ██╔══██╗██╔══██║╚════██║██╔══╝
██████╔╝ ██║ ██║ ███████╗██████╔╝██║ ██║███████║███████╗
╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝

Version 0.1.0 has started at http://localhost:8080


2021-07-12T05:43:54.914Z ERROR server/schema_syncer.go:62 Failed to sync instance {"id": 102, "name": "On-premises Prod MySQL", "error": "failed to connect instance: On-premises Prod MySQL with user: admin. Error dial tcp: lookup mysql.prod.example.com on 192.168.65.5:53: no such host"}`

Problem syncing RDS instances because rdsadmin private database

Provide the Bytebase version you are using
0.7.2

Describe the bug

Using PostgreSQL in a AWS RDS managed environment we can't properly sync existent databases because bytebase try to sync with a private database.

image

  1. Create a project
  2. Create a environment
  3. Create a instance ofr existant RDS resource
  4. Try to Sync existant databases

Expected behavior

Import all databases into bytebase without the private ones by RDS, or even if it can't connect with one of the databases the processes import the other accessible ones.

Additional context
In this function we see that bytebase database is excluded from sync, so maybe we can add rdsadmin or cloudsql (for GCP equivalent service) too?

bytebase/plugin/db/pg/pg.go

Lines 327 to 335 in 821a06f

func (driver *Driver) SyncSchema(ctx context.Context) ([]*db.DBUser, []*db.DBSchema, error) {
excludedDatabases := map[string]bool{
// Skip our internal "bytebase" database
"bytebase": true,
}
// Skip all system databases
for k := range systemDatabases {
excludedDatabases[k] = true
}

Missing or wrong background for the selected tabs when adding a new webhook

Describe the bug

Missing or wrong background for the selected tabs when adding a new webhook

Steps or screenshots to reproduce the behavior

  1. Go to projects, blogs.
  2. Select webhooks tab.

image
3. Add a new webhook
4. See error

image

Expected behavior

截屏2021-11-18 14 33 28

Desktop (please complete the following information):

  • Browser Chrome
  • Version 95

baseline scripts executed unexpectedly

Discussed in #350

Originally posted by NickStepanov January 10, 2022
Hi,

I am trying to test the use of Clickhouse with VCS based workflow.

I am creating a UI based baseline and it works fine.

After that, I am pushing a file to gitlab with my baseline, it get picked up by Bytebase and it even states:

SQL (This is a baseline migration and bytebase won't apply the SQL to the database, it will only record a baseline history)

After that, in the created issue, I try to click run, thinking that it will not touch my db, but I get

execute query ..... Table ...... already exists

It looks like my baseline file is trying to be executed my live db.

Is that an issue? Or am I doing something wrong?

Nik

instance sync database fail

Provide the MySQL version you are using (if related with instance/database operation)
5.7.34
Provide the Bytebase version you are using
0.4.1
The version info is shown on the bottom left of the console.

Describe the bug
instance sync database fail
Additional context

  1. Type conversion error.
  2. Database exists view. CREATE_TIME IS NULL
    fix bug

image

Support DML review workflow

bytebase 之后是否会考虑支持dml申请执行流程。

除了聚焦schema变更管理,dml执行流程也是日常工作的重点。如果ddl和dml需要两个不同的平台会比较麻烦~

install error via docker

Provide the Bytebase version you are using

0.11.0

Describe the bug

I follow the install docs https://docs.bytebase.com/install/docker but ends up with errors

2022-01-18T06:54:20.730Z	ERROR	server/backup_runner.go:60	Failed to retrieve backup settings match	{"error": "no such column: hook_url"}
github.com/bytebase/bytebase/server.(*BackupRunner).Run.func1.1
	/backend-build/server/backup_runner.go:60
github.com/bytebase/bytebase/server.(*BackupRunner).Run.func1
	/backend-build/server/backup_runner.go:125
2022-01-18T06:54:20.764Z	ERROR	server/anomaly_scanner.go:131	Failed to retrieve database list	{"instance": "MySQL Test (Follow the \"External Link\" field to bring up the MySQL server)", "error": "no such column: schema_version"}
github.com/bytebase/bytebase/server.(*AnomalyScanner).Run.func1.1.2
	/backend-build/server/anomaly_scanner.go:131
github.com/bytebase/bytebase/server.(*AnomalyScanner).Run.func1.1
	/backend-build/server/anomaly_scanner.go:140
github.com/bytebase/bytebase/server.(*AnomalyScanner).Run.func1
	/backend-build/server/anomaly_scanner.go:145

and there are error tips in the frontend
截屏2022-01-18 下午2 58 41

Schema update in VCS doesn't trigger Bytebase to apply the change

Provide the MySQL version you are using (if related with instance/database operation)
MySQL 5.6.30

Provide the GitLab version you are using (if related with VCS integration)
14.5.0

Provide the Bytebase version you are using
0.8.1

Describe the bug
After integrating with self hosted Gitlab, I set the file path template and schema path template, then committed a schema update to the repository matching the template, but nothing happened in Bytebase. Even with debug logging enabled, I don't see any activity on Bytebase.

Steps or screenshots to reproduce the behavior

  1. Integrate VCS with a project
  2. Set branch to master
  3. Set file path template to {{DB_NAME}}{{VERSION}}{{TYPE}}.sql
  4. Click Update button
  5. Commit a file in the root directory of the master branch named dbtest__202112031025__migrate.sql
  6. Expect something to happen in Bytebase but nothing happens
  7. Check the debug output, but there is nothing
  8. Confirm the instance name is dbtest
  9. Confirm the database name is dbtest

Expected behavior

I believe a new migration is supposed to happen in Bytebase, but I'm not sure if it's an issue where Gitlab is not calling Bytebase to do the update, or if Bytebase is not polling Gitlab for changes, or maybe it's not detecting a matching file pattern.

Desktop (please complete the following information):

  • Browser Firefox 91.3.0esr

Additional context

It would be helpful if the documentation explained in a little more detail what the process was. For example, does Gitlab send a webhook reqeust to Bytebase after committing to the repo, or does Bytebase periodically check for changes in the repo? Also it would be helpful in the case where Bytebase checked for schema updates to log that it didn't find any files matching the pattern.

Click on database name raises an "Internal Error".

Describe the bug

Click on database name raises an "Internal Error".

image

  1. Open the demo.
  2. Go to any Issue detail (e.g. 'Hello World!').
  3. Click on database name (e.g. 'testdb_prod') on the right side panel.
  4. See error

Expected behavior

Navigate to the database detail view maybe.

Desktop:

  • Chrome
  • 96

Error status code 422 trying to integrate version control with project

Provide the MySQL version you are using (if related with instance/database operation)
MariaDB 10.6.4

Provide the Bytebase version you are using
0.8.1

Describe the bug
After adding a project, database, initial migration schema, and Git provider (self hosted gitlab instance), I attempted to integrate my project with Gitlab. At the final step where you click Finish it gives me an error message "Failed to create webhook for project ID: 101, status code: 422"

Steps or screenshots to reproduce the behavior

  1. Go to project
  2. Click Version Control tab
  3. Click Version Control Workflow and click Configure version control button
  4. Click on existing Git provider
  5. Click on repo
  6. Enter "master" as the branch
  7. Click Finish
  8. See error: "Failed to create webhook for project ID: 101, status code: 422"

Expected behavior

Version control is integrated successfully.

Desktop (please complete the following information):

  • Browser Firefox 91.3.0esr

I'm not sure what to look for. I also tried unprotecting the master branch for the repo but I'm still seeing this error message. If it's relevant, I do not have any .sql files present in the repo yet as I'm not sure whether Bytebase is supposed to create them for me, or if I'm supposed to provide them ahead of time... I assumed Bytebase would generate the .sql files in the repo.

frontend will not reroute to the login page or prompt anything when the tocken is expired

Describe the bug

The backend clearly states that the token has expired, but the frontend can still router to every page normally.

Steps or screenshots to reproduce the behavior

  1. initiate frontend and backend
  2. shut down backend and restart
  3. randomly click some button, the backend would prompt : 401:Invalid or expired access token, internal=signature is invalid while the frontend behave abnormally.

If the error is not obvious, you can enable the --debug option on startup and attach the console message here

Expected behavior

The expected behavior is the frontend should show some info telling the user that this login has expires, and reroute to the login page.

Failed to start project with air

Provide the Bytebase version you are using

e6ccec44

Describe the bug

Following the instructions on README, I ran air -c scripts/.air.toml to start the server.
But it failed with the following output:

watching .
!exclude .air
watching api
watching bin
watching bin/bb
watching bin/bb/cmd
watching bin/server
watching bin/server/cmd
watching common
!exclude docs
watching external
watching external/gitlab
!exclude frontend
watching plugin
watching plugin/advisor
watching plugin/advisor/fake
watching plugin/advisor/mysql
watching plugin/db
watching plugin/db/clickhouse
watching plugin/db/mysql
watching plugin/db/pg
watching plugin/db/snowflake
watching plugin/db/util
watching plugin/webhook
watching scripts
watching server
watching store
watching store/migration
watching store/seed
watching store/seed/release
failed to watching /Users/satoru/projects/bytebase/store/seed/test, error: bad file descriptor

At first, I guessed it might be a bug of air. So I pulled the source code of air and started a debugger in GoLand to see what was happening under the hood.
It turned out that at the point of failure air just called fsnotify.Watcher.Add.
It surprised me that I could not reproduce the error with the debugger open. And it surprised me more when I verified that it worked whenever I ran it inside GoLand.
But it failed every time if I built and used the air binary directly.

Expected behavior

Server started successfully.

Clickhouse connection problems

Clickhouse 21.11.6.7
Bytebass 0.10.0 (docker)

Describe the bug
Trying to connect Clickhouse

When trying to connect a clickhouse server
An error of this type appears, failed to connect "172.17.0.2" for user "bytebase", could not load time location: unknown time zone Etc / UTC
Clickhouse has default settings

Reporting error when deploying 0.11.0

场景:目前 机器上有再运行的mysql instance docker安装0.10.0版本的时候 没有相关报错
ERROR server/anomaly_scanner.go:131 Failed to retrieve database list {"instance": "MySQL Prod (Follow the "External Link" field to bring up the MySQL server)", "error": "no such column: schema_version"}

Failed to create file after applying migration with GitLab branch with forward slash in the name

Provide the GitLab version you are using (if related with VCS integration)
14.6.2-ee

Provide the Bytebase version you are using
0.11.0

Describe the bug

When using VCS-based migrations with branch name like 'feature/newcolumn1', the run of the migration fails with:

failed to create file after applying migration 202201170001 to "test_db": failed to create file bytebase/test/.test_db__LATEST.sql on GitLab instance http://gitlab, status code: 400

When checking logs on GitLab instance:

"view_duration_s":0.2459,"status":400,"method":"POST","path":"/api/v4/projects/2/repository/files/bytebase%2Ftest%2F.test_db__LATEST.sql","params":[{"key":"branch","value":"newcolumn1"},{"key":"content","value":"[FILTERED]"},{"key":"commit_message","value":"[Bytebase] Create latest schema for \"test_db\" after migration 202201170001\n\nTHIS COMMIT IS AUTO-GENERATED BY BTYEBASE\n\nhttp://bytebase:8008/issue/update-bytebase-test-test_db__202201170001__migrate__add_new_col_user-sql-106?stage=107\n\n--------Original migration change--------\n\nhttp://gitlab.local.com/root/data-team-test/-/commit/b1db6df1617407f30df3836f12479d3689c0934c\n\nUpdate bytebase/test/test_db__202201170001__migrate__add_new_col_user.sql"}],"host":"gitlab","remote_ip":"172.16.57.2, 127.0.0.1","ua":"Go-http-client/1.1","route":"/api/:version/projects/:id/repository/files/:file_path","user_id":1,"username":"root","api_error":["{\"message\":\"You can only create or edit files when you are on a branch\"}"]

As you can see, parameters passed for branch name are:
"params":[{"key":"branch","value":"newcolumn1"}, however, the actual branch name is feature/newcolumn1

Therefore, it throws an error 400 with a message You can only create or edit files when you are on a branch

Steps or screenshots to reproduce the behavior

  1. Use VCS-based migration
  2. Create baseline
  3. Create new branch with the name containing forward slash
  4. Create migration
  5. Run the migration from the UI.

Expected behavior

Push and updated file of the schema to the GitLab branch.

Additional context

In the same GitLab log file I can see that the proper branch is being used, for example:

"params":[{"key":"branch","value":"feature/newcolumn1"},{"key":"commit_message"
This makes me believe that BB is incorrectly passing the branch name during the api call.

If I try branch name without forward slash - it all works as expected.

Unnecessary text explaining the project migration history maximum display count when there is no migration history at all

Describe the bug

Unnecessary text explaining the project migration history maximum display count when there is no migration history at all.

Steps or screenshots to reproduce the behavior

  1. Go to a project where none of its database contain migration history (e.g. a new project), and click "Migration History"
  2. It displays a label "For database having migration history, we list up to 5 most recent histories below. You can click the database name to view all histories."

screenshot

The label is unnecessary here since the project doesn't have any Migration History and increase user's cognitive load.

Expected behavior

We should only display this label if there is any migration history.

Improve language in docs & product

I love the product. However, the language in docs & product is sometimes awkward and/or contains grammar mistakes. While it does not affect understanding, I believe it is something that can be improved upon.

Some examples are:

  • It is not clear to me why three tenses are used here ("bookkeeping", "scan", & "detects")

Screen Shot 2022-01-09 at 11 35 21 AM

  • Is "project" countable? The usage is not consistent between the first sentence and the second and third. Also, A "project" is not comparable with a "project concept".

Screen Shot 2022-01-09 at 11 38 39 AM

I think the accumulation of details like these could affect how the product is overall perceived. Adding a dedicated writing style guide could be helpful (like the Apple Publications Style Guide).

Add schema design capability

希望可以加入数据库schema设计能力。
现在基于团队的数据库schema管理和设计是个痛点。
目前的在线数据库schema设计工具不少,团队所有成员可以参与到数据库的schema设计中来,他们大部分都是收费的;但是它们更像是一个画图软件,并没有数据库schema变更管理能力。
我们这个系统提供了数据库schema变更管理能力,但是却没有schema设计能力,是比较遗憾的。

Tip appears at wrong position at projects overview panel in demo

Describe the bug

See the screenshots.

Steps or screenshots to reproduce the behavior

  1. Go to projects-Blog(Git)-overview
  2. Scroll down to the bottom.

批注 2021-10-23 114234

Expected behavior

Tip should position at somewhere near the element.

批注 2021-10-23 113948

Desktop:

  • Browser [Chrome]
  • Version [95]

can't create dml sql on sql editor

Provide the MySQL version you are using (if related with instance/database operation)
PostgreSQL 12.06

Provide the GitLab version you are using (if related with VCS integration)

Provide the Bytebase version you are using
0.11.0

The version info is shown on the bottom left of the console.

Describe the bug

create a PostgreSQL instance, and correctly connect to pg with superuser permission. Then I want to execute a dml SQL, but can't working.

Steps or screenshots to reproduce the behavior

  1. See error
    Image_20220110180316

If the error is not obvious, you can enable the --debug option on startup and attach the console message here

Expected behavior

A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

Internal error occured

No matter which one you click, an error will be reported, and if it is correct, the correct information will be delayed

Internal error occured

pq: CREATE DATABASE cannot run inside a transaction block

Provide the MySQL version you are using (if related with instance/database operation)
postgres 12.6

Provide the GitLab version you are using (if related with VCS integration)

Provide the Bytebase version you are using
v0.9.0 use docker run

The version info is shown on the bottom left of the console.

Describe the bug

A clear and concise description of what the bug is.

Steps or screenshots to reproduce the behavior

Image_20211220152201

If the error is not obvious, you can enable the --debug option on startup and attach the console message here

Expected behavior

create database func is ok.

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

Schema drift detection seems incorrect

Provide the MySQL version you are using (if related with instance/database operation)
MySQL 5.6.30

Provide the GitLab version you are using (if related with VCS integration)
14.5.1

Provide the Bytebase version you are using
0.8.1

Describe the bug
Schema drift detected, but actual schema has not changed. Most notably, there are two things it keeps telling me are different:

  1. I have not made any changes to any tables, views, or stored procedures. However, the schema drift diff is showing that the Actual contains a bunch of views/stored procedures and some tables that in fact already exist in the .dbname__LATEST.sql file.
  2. AUTO_INCREMENT values: I consider this to be data, not structure and so would expect Bytebase to ignore AUTO_INCREMENT values when comparing schema diffs. I can't think of a scenario where I would use this in production.

Steps or screenshots to reproduce the behavior
Do a baseline migration, then check the schema drift.

Expected behavior

Schema drift should not be detected, except possibly the AUTO_INCREMENT values, if there is a valid use case to compare these values in production.

Failed to create table in mysql 5.7

failed to get tables of database "test-123": getTableStmt("test-123", "a", "BASE TABLE") got error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-123.a' at line 1
CREATE TABLE a (
id mediumint(9) DEFAULT NULL,
accountId varchar(64) DEFAULT NULL,
roleId int(11) DEFAULT NULL,
roleName varchar(100) DEFAULT NULL,
icon varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.