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

pnpm run init failed. #11485

Closed
hatsuyuki2333 opened this issue Aug 7, 2023 · 4 comments
Closed

pnpm run init failed. #11485

hatsuyuki2333 opened this issue Aug 7, 2023 · 4 comments
Labels
⚠️bug? This might be a bug

Comments

@hatsuyuki2333
Copy link

💡 Summary

pnpm run init failed

🥰 Expected Behavior

everything goes well,then i will have an environment that suitable to run misskey.

🤬 Actual Behavior

here is the log.

$ pnpm run init

> misskey@13.14.2 init /home/yuki/workspace/misskey
> pnpm migrate


> misskey@13.14.2 migrate /home/yuki/workspace/misskey
> cd packages/backend && pnpm migrate


> backend@ migrate /home/yuki/workspace/misskey/packages/backend
> pnpm typeorm migration:run -d ormconfig.js

query: SELECT * FROM current_schema()
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY ("id"))
query failed: CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT NULL, "name" character varying NOT
 NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY ("id"))
error: error: permission denied for schema public
Error during migration run:
QueryFailedError: permission denied for schema public
    at PostgresQueryRunner.query (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PostgresQueryRunner.executeQueries (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/query-runner/BaseQueryRunner.js:424:13)
    at async PostgresQueryRunner.createTable (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:410:9)
    at async MigrationExecutor.createMigrationsTableIfNotExist (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/migration/MigrationExecutor.js:351:13)
    at async MigrationExecutor.executePendingMigrations (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/migration/MigrationExecutor.js:129:9)
    at async DataSource.runMigrations (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/data-source/DataSource.js:260:35)
    at async Object.handler (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/commands/MigrationRunCommand.js:68:13) {
  query: 'CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY ("id"))',
  parameters: undefined,
  driverError: error: permission denied for schema public
      at /home/yuki/workspace/misskey/node_modules/.pnpm/pg@8.11.1/node_modules/pg/lib/client.js:526:17
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async PostgresQueryRunner.query (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:178:25)
      at async PostgresQueryRunner.executeQueries (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/query-runner/BaseQueryRunner.js:424:13)
      at async PostgresQueryRunner.createTable (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:410:9)
      at async MigrationExecutor.createMigrationsTableIfNotExist (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/migration/MigrationExecutor.js:351:13)
      at async MigrationExecutor.executePendingMigrations (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/migration/MigrationExecutor.js:129:9)
      at async DataSource.runMigrations (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/data-source/DataSource.js:260:35)
      at async Object.handler (/home/yuki/workspace/misskey/node_modules/.pnpm/typeorm@0.3.17_ioredis@5.3.2_pg@8.11.1/node_modules/typeorm/commands/MigrationRunCommand.js:68:13) {
    length: 99,
    severity: 'ERROR',
    code: '42501',
    detail: undefined,
    hint: undefined,
    position: '14',
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'aclchk.c',
    line: '3650',
    routine: 'aclcheck_error'
  },
  length: 99,
  severity: 'ERROR',
  code: '42501',
  detail: undefined,
  hint: undefined,
  position: '14',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'aclchk.c',
  line: '3650',
  routine: 'aclcheck_error'
}
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

📝 Steps to Reproduce

1.FOLLOW EVERY STEPS ON THE INSTALL MANUAL ON MISSKEY HUB, FROM 1 TO 6.

📌 Environment

Misskey@13.14.2
Node@20.5.0
pnpm@8.6.10
Armbian 23.08.0-trunk Aarch64 on RockChip RK3318 (Debian 12 Bookworm)
PostgreSQL 15.3

💻 Frontend

  • Model and OS of the device(s):
  • Browser:
  • Server URL:
  • Misskey:
    13.x.x

🛰 Backend (for server admin)

  • Installation Method or Hosting Service:
  • Misskey: 13.x.x
  • Node: 20.x.x
  • PostgreSQL: 15.x.x
  • Redis: 7.x.x
  • OS and Architecture:
@hatsuyuki2333 hatsuyuki2333 added the ⚠️bug? This might be a bug label Aug 7, 2023
@mattyatea
Copy link
Member

It is a permission error, so please make sure that the appropriate user owns the database. 

@hatsuyuki2333
Copy link
Author

I know it's a permission error. The tutorial uses user postgres to create the database, but the directory was owned by user yuki. If this caused the problem, then how to solve it?

@hatsuyuki2333
Copy link
Author

I know it's a permission error. The tutorial uses user postgres to create the database, but the directory was owned by user yuki. If this caused the problem, then how to solve it?

When I run sudo -u postgres psql , it returned an error: could not change directory to "/home/yuki/workspace/misskey": permission denied

@hatsuyuki2333
Copy link
Author

Finally worked out.
I use ALTER DATABASE misskey OWNER TO misskey; to make misskey a database admin and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

No branches or pull requests

2 participants