Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.33k stars 1.06k forks source link

Edit Content Pack page throw an exception #6883

Open edmundoa opened 4 years ago

edmundoa commented 4 years ago

When creating a new Content Pack revision, the edit page never loads. Looking at the web console, I can see this exception being thrown:

Unhandled rejection TypeError: Cannot read property 'createNewVersionFromRev' of undefined
    at http://localhost:8080/app.js:122246:49
From previous event:
    at Object.componentDidMount (http://localhost:8080/app.js:122244:51)
    at Object.chainedFunction [as componentDidMount] (webpack://__%5Bname%5D/./node_modules/create-react-class/factory.js?:663:11)
    at commitLifeCycles (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:20049:22)
    at commitLayoutEffects (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:22813:7)
    at HTMLUnknownElement.callCallback (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:347:14)
    at Object.invokeGuardedCallbackDev (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:397:16)
    at invokeGuardedCallback (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:454:31)
    at commitRootImpl (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:22585:9)
    at unstable_runWithPriority (webpack://__%5Bname%5D/./node_modules/scheduler/cjs/scheduler.development.js?:643:12) 
   at runWithPriority$2 (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:11305:10)
    at commitRoot (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:22414:3)
    at runRootCallback (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:21554:20)
    at eval (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:11353:24)
    at unstable_runWithPriority (webpack://__%5Bname%5D/./node_modules/scheduler/cjs/scheduler.development.js?:643:12)
    at runWithPriority$2 (webpack://__%5Bname%5D/./node_modules/react-dom/cjs/react-dom.development.js?:11305:10) 
(...)

I verified that this still works in 3.1.3.

Expected Behavior

It should be possible to create a new Content Pack revision.

Current Behavior

The page to create a new Content Pack revision throws an error and never loads.

Possible Solution

Looking a bit into the code, it seems that the bug originated on this line of EditContentPackPage. As far as I can see, contentPackRevisions will only be set in the component's state once the ContentPacksActions.get() is fulfilled.

Steps to Reproduce (for bugs)

  1. Go to Content Packs page
  2. For one of the existing Content Packs, click on More Actions -> Create New Revision
  3. See that the page never finishes loading and an error appears in the browser's console

Your Environment

pschichtel commented 4 years ago

I can confirm this. Just upgraded our development setup to 3.2 for content pack auto import and had to fix a pipeline rule. I'm unable to update the content pack now.

pschichtel commented 4 years ago

This seems to work on 3.2.2, so this can probably be closed.