Graylog2 / Graylog2/graylog2-server

Edit Content Pack page throw an exception

Open
#6,883 2 comments 0 reactions 0 assignees View on GitHub
bug content-packs triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

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`](https://github.com/Graylog2/graylog2-server/blob/9b7902db4feecfd5f49775aeb802f38bae0417ce/graylog2-web-interface/src/pages/EditContentPackPage.jsx#L43). 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
* Graylog Version: Graylog-3.2.0-SNAPSHOT(9b68d1c6f)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.