Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`masterKey` function is not called on server start

Đang mở Phù hợp với người mới
#10,710 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong src/ParseServer.ts tại ParseServer.start() và theo dõi cách các tác vụ khởi động truy cập các tùy chọn được Config.put() trả về. Tái hiện vấn đề với một hàm masterKey từ chối, sau đó xác minh rằng quá trình khởi động gọi nó và từ chối trước khi phục vụ các yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

New Issue Checklist
Issue Description

If the Parse Server option masterKey is set to a function, the function is supposed to be called when Parse Server starts; ParseServer.start() in src/ParseServer.ts adds this.config.loadMasterKey?.() to the startup tasks. However, this.config is the plain options object returned by Config.put(), not a Config instance. It has no loadMasterKey method, so the optional call does nothing. This has been the case since setting masterKey to a function was added in #9582 (Parse Server 8.0.0).

As a result, the function is only called on the first request. If it fails, for example because a secret store is unavailable, Parse Server starts nonetheless and responds to every request with status 500, including the /health endpoint. Other startup tasks, such as the migration of the schema option or the connection of the cache adapter, make the start fail instead.

Steps to reproduce
  1. Start Parse Server with masterKey: () => Promise.reject(new Error('secret store unavailable')), and await ParseServer.start().
  2. Send any request, for example GET /parse/health.
Actual Outcome

ParseServer.start() resolves; the masterKey function has not been called. The request fails with status 500 and {"code":1,"message":"Internal server error."}, and so does every following request.

Expected Outcome

The masterKey function is called when Parse Server starts, and ParseServer.start() rejects if the function fails.

Environment

Server

  • Parse Server version: 9.10.2-alpha.4 (alpha branch); since 8.0.0
  • Operating system: any
  • Local or remote host: any

Database

  • System: any
  • Database version: any
  • Local or remote host: any

Client

  • SDK: any
  • SDK version: any
Logs

Not applicable

Ngôn ngữ chính
JavaScript
Star
21.4k
Fork
4.8k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
49

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của parse-community/parse-server

Tất cả issue của parse-community/parse-server

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.