{"record":{"id":"aa8e27def1961ea7","repo":"gollum/gollum","slug":"not-found","errorCode":null,"errorMessage":"Not found.","messagePattern":"Not found\\.","errorType":"http","errorClass":null,"httpStatus":404,"severity":"info","filePath":"lib/gollum/helpers.rb","lineNumber":62,"sourceCode":"    def clean_url(url)\n      return url if url.nil?\n      url.gsub('%2F', '/').gsub(%r{/{2,}}, '/').gsub(%r{^/}, '')\n    end\n\n    def forbid(msg = \"Forbidden. This wiki is set to no-edit mode.\")\n      @message = msg\n      status 403\n      halt mustache :error\n    end\n\n    def not_found(msg = nil)\n      @message = msg || \"The requested page does not exist.\"\n      status 404\n      return mustache :error\n    end\n    \n    def not_found_proc\n      not_found_msg = 'Not found.'\n      Proc.new {[404, {'Content-Type' => 'text/html', 'Content-Length' => not_found_msg.length.to_s}, [not_found_msg]]}\n    end\n    \n    def emoji(name)\n      if emoji = Gemojione.index.find_by_name(name)\n        IO.read(EMOJI_PATHNAME.join(\"#{emoji['unicode'].downcase}.png\"))\n      else\n        fail ArgumentError, \"emoji `#{name}' not found\"\n      end\n    end\n  end\nend\n","sourceCodeStart":44,"sourceCodeEnd":75,"githubUrl":"https://github.com/gollum/gollum/blob/d00fefc89be0ab22ab862a51299120a55ccd9280/lib/gollum/helpers.rb#L44-L75","documentation":"not_found_proc builds a bare Rack 404 response - body 'Not found.', Content-Type text/html, explicit Content-Length - and is used as the fallback app handed to Rack::Static for the MathJax mount (app.rb line 176) and the static assets mount (line 183). When a requested file is not on disk under those roots, this proc answers; there is no gollum error page and no logging.","triggerScenarios":"Requesting /mathjax/... paths when the MathJax option/path is unconfigured or its directory is incomplete; requesting any static asset filename that does not exist on disk.","commonSituations":"Package installs where MathJax assets are not bundled or the :mathjax option points at a partial directory; proxies and scanners probing asset paths; upgraded gollum versions with moved assets.","solutions":["Configure MathJax properly (gollum --mathjax / wiki_options) and verify the directory actually contains the requested files","Fix or remove broken asset URLs in your templates","Expect the plain 'Not found.' body (not HTML) from these paths when debugging"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"asset = File.join(static_root, env['PATH_INFO'].to_s)\nFile.file?(asset) ? File.read(asset) : nil\n# serve only when the file exists; otherwise expect the bare 'Not found.' 404","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the MathJax/static asset directories exist on disk after installs and upgrades","Don't rely on HTML error pages under /mathjax or asset paths - the fallback is a plain-text 404"],"tags":["gollum","static-assets","http-404","rack","mathjax"],"backgroundTag":"static-asset-not-found","analyzedSha":"d00fefc89be0ab22ab862a51299120a55ccd9280","analyzedAt":"2026-08-21T15:14:18.608Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}