instructure/canvas-lms · error · ActiveRecord::RecordNotFound
Quiz not found
Error message
Quiz not found
What it means
Generic not-found guard in Filters::Quizzes#require_quiz: no quiz exists in @context matching params[:quiz_id] (or params[:id]). This sentinel ActiveRecord::RecordNotFound is raised for every quizzes API/controller route needing a quiz.
Solutions
- Verify the quiz_id/id references an existing, non-deleted quiz in the given course
- Check for typo'd or stale quiz ids from the client
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at app/controllers/filters/quizzes.rb:28 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/bdfe2701cafdc7b2.
Report an issue: GitHub.
Appendix: source
Thrown at app/controllers/filters/quizzes.rb:28
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
module Filters::Quizzes
protected
def require_quiz
id = params.key?(:quiz_id) ? params[:quiz_id] : params[:id]
unless (@quiz = @context.quizzes.find(id))
raise ActiveRecord::RecordNotFound, "Quiz not found"
end
@quiz
end
def require_course
@course = api_find(Course.active, params[:course_id])
params[:context_id] = params[:course_id]
params[:context_type] = "Course"
authorized_action(@course, @current_user, :read)
end
end
View on GitHub (pinned to 1c9f0bb801)