{"record":{"id":"900cf9b50dbcef7b","repo":"instructure/canvas-lms","slug":"you-must-run-gulp-rev-first","errorCode":null,"errorMessage":"you must run \"gulp rev\" first","messagePattern":"you must run \"gulp rev\" first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"lib/canvas/cdn/registry/gulp.rb","lineNumber":54,"sourceCode":"        def url_for(file)\n          #   source looks like \"/images/apple-touch-icon.png\"\n          #             or like \"/dist/images/apple-touch-icon.png\"\n          # virtpath looks like \"images/apple-touch-icon.png\"\n          # realpath looks like \"/dist/images/apple-touch-icon-585e5d997d.png\"\n          if (fingerprinted = @manifest[virtpath(file)])\n            realpath(fingerprinted)\n          end\n        end\n\n        private\n\n        def load_manifest_from_disk\n          file = Rails.public_path.join(\"dist/rev-manifest.json\")\n\n          if file.exist?\n            JSON.parse(file.read).freeze\n          elsif Rails.env.production?\n            raise \"you must run \\\"gulp rev\\\" first\"\n          else\n            {}\n          end\n        end\n\n        def virtpath(source)\n          normal = source.sub(%r{^/}, \"\")\n\n          if normal.start_with?(@asset_dir)\n            normal[(@asset_dir.length + 1)..]\n          else\n            normal\n          end\n        end\n\n        def realpath(vfile)\n          \"/#{@asset_dir}/#{vfile}\"\n        end","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/canvas/cdn/registry/gulp.rb#L36-L72","documentation":"The gulp CDN registry maps original asset paths to fingerprinted ones via public/dist/rev-manifest.json, generated by 'gulp rev'. In production, if that manifest is missing, it raises this error instead of silently returning an empty map (as it does in dev). Serving assets without it would produce wrong/unfingerprinted URLs.","triggerScenarios":"Any asset-path lookup through the gulp registry in a production Rails env where public/dist/rev-manifest.json does not exist at boot of load_manifest_from_disk.","commonSituations":"Production image built without running gulp rev; manifest wiped by a public/ cleanup; running rails in RAILS_ENV=production on a laptop without the full frontend build.","solutions":["Run yarn/gulp build including 'gulp rev' to generate public/dist/rev-manifest.json","Rebuild the production asset bundle as part of the deploy pipeline","Ensure RAILS_ENV is not production for local dev, or commit/generate manifests before boot","Verify file existence in the deploy health check before starting Rails"],"exampleFix":"// before\nRails.env.production? && !Rails.public_path.join('dist/rev-manifest.json').exist? # raises\n// after\n$ gulp rev   # writes public/dist/rev-manifest.json","handlingStrategy":"fallback","validationCode":"raise 'rev manifest missing' unless Rails.public_path.join('dist/rev-manifest.json').exist?","typeGuard":null,"tryCatchPattern":"begin\n  registry.load_manifest_from_disk\nrescue RuntimeError => e\n  raise unless e.message.include?('gulp rev')\n  {}\nend","preventionTips":["Run full asset pipeline (incl. gulp rev) in production builds","Do not wipe public/dist in deployed images","Startup check that required manifests exist"],"tags":["ruby","assets","cdn","rev-manifest"],"backgroundTag":"missing-build-artifact","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}