Misskey: "registry_item" does not exist

Created on 18 Jan 2021  ·  13Comments  ·  Source: syuilo/misskey

💡 Summary

  1. As admin, the side panel is the same as a normal user.(No icon for instance)

  2. image
    The place for avatar and username is not clickable. Respond with error 400"Invalid param"
  3. Anything related to /api/i/registry/get-all returns with error 500 in front end and
ERR  1  [api]   Internal error occurred in i: relation "registry_item" does not exist
ERR  1  [api]   Internal error occurred in i: relation "registry_item" does not exist
ERR  1  [api]   Internal error occurred in i/registry/get-all: relation "registry_item" does not exist

in server log

🙂 Expected Behavior

No such ERR

☹️ Actual Behavior

ERR  1  [api]   Internal error occurred in i: relation "registry_item" does not exist
ERR  1  [api]   Internal error occurred in i: relation "registry_item" does not exist
ERR  1  [api]   Internal error occurred in i/registry/get-all: relation "registry_item" does not exist

📝 Steps to Reproduce

  1. I built the newest v12.67.1 on local machine
  2. Upload to the server to update
  3. yarn migrate
  4. Does not work even after roll back to v12.67.0

    📌 Environment

Misskey v12.67.1
1C 2T 2G RAM VPS
CentOS 7.9.2009
node.js v14.15.3
yarn v1.22.10
Nginx v1.17.10
Redis v6.0.9
PostgreSQL v13.0

⚙️Server ⚠️bug?

Most helpful comment

Thanks @ybw2016v !!!!!

SOLVED: Caused by git pull incomplete

7073

the /misskey/migration missed files from https://github.com/syuilo/misskey/tree/master/migration

The problem was caused by incomplete git pull: The files pulled to the server is missing files from the repo.
Possible reasons:

  1. bad network
  2. misinterpretation of the official guide. NOT ONLY /built need to be uploaded, BUT ALSO other folders.
    この「6.生成されたbuiltフォルダーをサーバーにコピー」を誤読した。builtフォルダーだけではなく、他のフォルダーサーバーにコピーする必要はあります。

For reason 1, try more times. I believe that the problem for me was reason 2. Solution is

Either build on server, or upload everything to the server.

All 13 comments

It maybe because PostgreSQL accidently stopped a few seconds and caused this problem... Only users who were online that time All users were affected.

It appears nothing works now, including users and instance settings. I tried to search word “registry” in database and nothing appears....

I initialized another postgreSQL to try newly install one, but same error appeared. There is high chance the issue was caused by the update

Which version did you update from?

Which version did you update from?

Misskey v12.67.0

hmmm... Is

I initialized another postgreSQL to try newly install one, but same error appeared. There is high chance the issue was caused by the update

means yarn migrate for the another postgresql system and DB?

I initialized another postgreSQL to try newly install one, but same error appeared. There is high chance the issue was caused by the update

Created another database (and built using new database's config) and then yarn run init

Including users and instance settings.

User settings came back to work as normal. However several critical bugs still cannot be solved currently:

  1. As admin, the side panel is the same as a normal user.(No icon for instance)

  2. image
    The place for avatar and username is not clickable. Respond with error 400"Invalid param"
  3. Anything related to /api/i/registry/get-all returns with error 500 in front end and
ERR  1  [api]   Internal error occurred in i: relation "registry_item" does not exist
ERR  1  [api]   Internal error occurred in i: relation "registry_item" does not exist
ERR  1  [api]   Internal error occurred in i/registry/get-all: relation "registry_item" does not exist

in server log

Is there a log for yarn migrate?

Is there a log for yarn migrate?
Newest↓

[misskey@host misskey]$ yarn migrate
yarn run v1.22.10
$ ts-node ./node_modules/typeorm/cli.js migration:run
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = current_schema() AND "table_name" = 'migrations'
query: SELECT * FROM "migrations" "migrations"  ORDER BY "id" DESC
No migrations are pending
Done in 91.36s.

Thank you!
Can you share the contents of your built/db/postgre.js file?

built/db/postgre.js file

postgre.js.txt
↑In case the below is not accurate

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initDb = exports.entities = void 0;
const typeorm_1 = require("typeorm");
const config_1 = require("../config");
const entities_1 = require("../services/chart/entities");
const logger_1 = require("./logger");
const highlight = require("cli-highlight");
const log_1 = require("../models/entities/log");
const user_1 = require("../models/entities/user");
const drive_file_1 = require("../models/entities/drive-file");
const drive_folder_1 = require("../models/entities/drive-folder");
const access_token_1 = require("../models/entities/access-token");
const app_1 = require("../models/entities/app");
const poll_vote_1 = require("../models/entities/poll-vote");
const note_1 = require("../models/entities/note");
const note_reaction_1 = require("../models/entities/note-reaction");
const note_watching_1 = require("../models/entities/note-watching");
const note_unread_1 = require("../models/entities/note-unread");
const notification_1 = require("../models/entities/notification");
const meta_1 = require("../models/entities/meta");
const following_1 = require("../models/entities/following");
const instance_1 = require("../models/entities/instance");
const muting_1 = require("../models/entities/muting");
const sw_subscription_1 = require("../models/entities/sw-subscription");
const blocking_1 = require("../models/entities/blocking");
const user_list_1 = require("../models/entities/user-list");
const user_list_joining_1 = require("../models/entities/user-list-joining");
const user_group_1 = require("../models/entities/user-group");
const user_group_joining_1 = require("../models/entities/user-group-joining");
const user_group_invitation_1 = require("../models/entities/user-group-invitation");
const hashtag_1 = require("../models/entities/hashtag");
const note_favorite_1 = require("../models/entities/note-favorite");
const abuse_user_report_1 = require("../models/entities/abuse-user-report");
const registration_tickets_1 = require("../models/entities/registration-tickets");
const messaging_message_1 = require("../models/entities/messaging-message");
const signin_1 = require("../models/entities/signin");
const auth_session_1 = require("../models/entities/auth-session");
const follow_request_1 = require("../models/entities/follow-request");
const emoji_1 = require("../models/entities/emoji");
const game_1 = require("../models/entities/games/reversi/game");
const matching_1 = require("../models/entities/games/reversi/matching");
const user_note_pining_1 = require("../models/entities/user-note-pining");
const poll_1 = require("../models/entities/poll");
const user_keypair_1 = require("../models/entities/user-keypair");
const user_publickey_1 = require("../models/entities/user-publickey");
const user_profile_1 = require("../models/entities/user-profile");
const user_security_key_1 = require("../models/entities/user-security-key");
const attestation_challenge_1 = require("../models/entities/attestation-challenge");
const page_1 = require("../models/entities/page");
const page_like_1 = require("../models/entities/page-like");
const moderation_log_1 = require("../models/entities/moderation-log");
const used_username_1 = require("../models/entities/used-username");
const announcement_1 = require("../models/entities/announcement");
const announcement_read_1 = require("../models/entities/announcement-read");
const clip_1 = require("../models/entities/clip");
const clip_note_1 = require("../models/entities/clip-note");
const antenna_1 = require("../models/entities/antenna");
const antenna_note_1 = require("../models/entities/antenna-note");
const promo_note_1 = require("../models/entities/promo-note");
const promo_read_1 = require("../models/entities/promo-read");
const argv_1 = require("../argv");
const relay_1 = require("../models/entities/relay");
const muted_note_1 = require("../models/entities/muted-note");
const channel_1 = require("../models/entities/channel");
const channel_following_1 = require("../models/entities/channel-following");
const channel_note_pining_1 = require("../models/entities/channel-note-pining");
const registry_item_1 = require("../models/entities/registry-item");
const sqlLogger = logger_1.dbLogger.createSubLogger('sql', 'white', false);
class MyCustomLogger {
    highlight(sql) {
        return highlight.highlight(sql, {
            language: 'sql', ignoreIllegals: true,
        });
    }
    logQuery(query, parameters) {
        if (argv_1.program.verbose) {
            sqlLogger.info(this.highlight(query));
        }
    }
    logQueryError(error, query, parameters) {
        sqlLogger.error(this.highlight(query));
    }
    logQuerySlow(time, query, parameters) {
        sqlLogger.warn(this.highlight(query));
    }
    logSchemaBuild(message) {
        sqlLogger.info(message);
    }
    log(message) {
        sqlLogger.info(message);
    }
    logMigration(message) {
        sqlLogger.info(message);
    }
}
exports.entities = [
    announcement_1.Announcement,
    announcement_read_1.AnnouncementRead,
    meta_1.Meta,
    instance_1.Instance,
    app_1.App,
    auth_session_1.AuthSession,
    access_token_1.AccessToken,
    user_1.User,
    user_profile_1.UserProfile,
    user_keypair_1.UserKeypair,
    user_publickey_1.UserPublickey,
    user_list_1.UserList,
    user_list_joining_1.UserListJoining,
    user_group_1.UserGroup,
    user_group_joining_1.UserGroupJoining,
    user_group_invitation_1.UserGroupInvitation,
    user_note_pining_1.UserNotePining,
    user_security_key_1.UserSecurityKey,
    used_username_1.UsedUsername,
    attestation_challenge_1.AttestationChallenge,
    following_1.Following,
    follow_request_1.FollowRequest,
    muting_1.Muting,
    blocking_1.Blocking,
    note_1.Note,
    note_favorite_1.NoteFavorite,
    note_reaction_1.NoteReaction,
    note_watching_1.NoteWatching,
    note_unread_1.NoteUnread,
    page_1.Page,
    page_like_1.PageLike,
    log_1.Log,
    drive_file_1.DriveFile,
    drive_folder_1.DriveFolder,
    poll_1.Poll,
    poll_vote_1.PollVote,
    notification_1.Notification,
    emoji_1.Emoji,
    hashtag_1.Hashtag,
    sw_subscription_1.SwSubscription,
    abuse_user_report_1.AbuseUserReport,
    registration_tickets_1.RegistrationTicket,
    messaging_message_1.MessagingMessage,
    signin_1.Signin,
    moderation_log_1.ModerationLog,
    clip_1.Clip,
    clip_note_1.ClipNote,
    antenna_1.Antenna,
    antenna_note_1.AntennaNote,
    promo_note_1.PromoNote,
    promo_read_1.PromoRead,
    game_1.ReversiGame,
    matching_1.ReversiMatching,
    relay_1.Relay,
    muted_note_1.MutedNote,
    channel_1.Channel,
    channel_following_1.ChannelFollowing,
    channel_note_pining_1.ChannelNotePining,
    registry_item_1.RegistryItem,
    ...entities_1.entities
];
function initDb(justBorrow = false, sync = false, forceRecreate = false) {
    if (!forceRecreate) {
        try {
            const conn = typeorm_1.getConnection();
            return Promise.resolve(conn);
        }
        catch (e) { }
    }
    const log = process.env.NODE_ENV != 'production';
    return typeorm_1.createConnection({
        type: 'postgres',
        host: config_1.default.db.host,
        port: config_1.default.db.port,
        username: config_1.default.db.user,


     password: config_1.default.db.pass,
        database: config_1.default.db.db,
        extra: config_1.default.db.extra,
        synchronize: process.env.NODE_ENV === 'test' || sync,
        dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
        cache: !config_1.default.db.disableCache ? {
            type: 'redis',
            options: {
                host: config_1.default.redis.host,
                port: config_1.default.redis.port,
                password: config_1.default.redis.pass,
                prefix: `${config_1.default.redis.prefix}:query:`,
                db: config_1.default.redis.db || 0
            }
        } : false,
        logging: log,
        logger: log ? new MyCustomLogger() : undefined,
        entities: exports.entities
    });
}
exports.initDb = initDb;

Thanks @ybw2016v !!!!!

SOLVED: Caused by git pull incomplete

7073

the /misskey/migration missed files from https://github.com/syuilo/misskey/tree/master/migration

The problem was caused by incomplete git pull: The files pulled to the server is missing files from the repo.
Possible reasons:

  1. bad network
  2. misinterpretation of the official guide. NOT ONLY /built need to be uploaded, BUT ALSO other folders.
    この「6.生成されたbuiltフォルダーをサーバーにコピー」を誤読した。builtフォルダーだけではなく、他のフォルダーサーバーにコピーする必要はあります。

For reason 1, try more times. I believe that the problem for me was reason 2. Solution is

Either build on server, or upload everything to the server.

Was this page helpful?
0 / 5 - 0 ratings