ActiveRecord::RecordNotFound in WebController#web_subcategory

Couldn't find Category with id=

Extracted source (around line #325):
323
324
325
326
327
328
          
if Category.first.present?
if Category.first.levels == 3
@principal2 = Category.find(Category.find(@category_id).ancestry.partition("/").last)
else
@principal2 = Category.find(Category.find(@category_id).ancestry.first)
end

Rails.root: /var/www/vhosts/fivesneakershop.com/fivenew

Application Trace | Framework Trace | Full Trace
app/controllers/web_controller.rb:325:in `web_subcategory'

Request

Parameters:

{"id"=>"21-camisetas-mujer"}

Response

Headers:

None