appkit_cache_entries migration ownership issue
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 28/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- postgresql, typescript
调研方向
The failing migrations run from PersistentStorage.runMigrations in src/cache/storage/persistent.ts (around line 324), called from PersistentStorage.initialize and CacheManager.create in src/cache/index.ts. Start by reading how the pg pool is created and which role runs the DDL. The issue leaves the option's name and shape open, so agree the design with maintainers before coding. Done when a migration role can be configured and the table-owner error no longer occurs.
由索引模型根据 Issue 内容生成。
描述
Problem
When starting an appkit locally, Appkit tries to run a migration script for the appkit_cache_entries table.
When the migration runs for the first time, it locks the owner as the current identity. If we have the app deployed in Databricks, it will use the App service principal.
The problem comes when another user tries to run the app with their own credentials. The migration will fail because Appkit will try the default identity to run the DDLs, which is not the owner of the table/schema.
Proposed Solution
I propose Appkit allow us to define a role to run migrations as an optional parameter.
Detailed error message
[appkit:cache:persistent] Migration step 'create index (key_hash)' failed: error: must be owner of table appkit_cache_entries
at C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\[email protected][email protected]\node_modules\pg-pool\index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async PersistentStorage.runMigrations (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\storage\persistent.ts:324:9)
at async PersistentStorage.initialize (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\storage\persistent.ts:58:7)
at async CacheManager.create (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\index.ts:188:9)
at async AppKit._createApp (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\core\appkit.ts:214:5) {
length: 103,
severity: 'ERROR',
code: '42501',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'aclchk.c',
line: '2981',
routine: 'aclcheck_error'
}
[appkit:cache:persistent] Error in persistent storage initialization: InitializationError: Error in running migrations for persistent storage
at InitializationError.migrationFailed (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\errors\initialization.ts:47:12)
at PersistentStorage.runMigrations (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\storage\persistent.ts:327:35)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async PersistentStorage.initialize (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\storage\persistent.ts:58:7)
at async CacheManager.create (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\index.ts:188:9)
at async AppKit._createApp (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\core\appkit.ts:214:5) {
cause: error: must be owner of table appkit_cache_entries
at C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\[email protected][email protected]\node_modules\pg-pool\index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async PersistentStorage.runMigrations (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\storage\persistent.ts:324:9)
at async PersistentStorage.initialize (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\storage\persistent.ts:58:7)
at async CacheManager.create (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\cache\index.ts:188:9)
at async AppKit._createApp (C:\Users\aborsato\dev\udp\supply-chain-apps\red_keychain\src\red_keychain\node_modules\.pnpm\@[email protected]_@_71adcd3664c0a60618d3aa5c60033ec6\node_modules\@databricks\appkit\src\core\appkit.ts:214:5) {
length: 103,
severity: 'ERROR',
code: '42501',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'aclchk.c',
line: '2981',
routine: 'aclcheck_error'
},
context: undefined,
_clientMessage: undefined,
code: 'INITIALIZATION_ERROR',
statusCode: 500,
isRetryable: true
}
- 主要语言
- TypeScript
- 星标
- 119
- 派生
- 36
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 37
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
databricks/appkit 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
databricks/appkit#729 ·
维护者通常 3 天内回复
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hours可能已有人在做 @billmcmillin 于 5 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 20/100
databricks/appkit#718 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
databricks/appkit#699 ·
维护者通常 3 天内回复
-
难度 3/5 半天 新手友好度 42/100
databricks/appkit#656 · 1 条评论 ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
databricks/appkit#603 ·
维护者通常 3 天内回复
查看 databricks/appkit 的全部 Issue
相似的 Issue
-
Add "append" and "prepend" slots for vue-vuetify extended renderers可能已有人在做 @simeyc 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eclipsesource/jsonforms#2668 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
README の通知条件を実際の判定処理に合わせる可能已有人在做 @unhappychoice 今天认领。 未关闭factory:in-progress priority:medium
难度 1/5 1 小时以内 新手友好度 90/100
unhappychoice/oss-issue-opener#395 · 1 条评论 ·
维护者通常 1 天内回复
-
bug Website
难度 2/5 1-3 小时 新手友好度 77/100
OWASP/OWASP-Hunting#88 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复