Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Konga crashes when adding API key to consumer with no prior keys #4

Closed
sashahilton00 opened this issue Nov 16, 2016 · 15 comments
Closed

Comments

@sashahilton00
Copy link
Contributor

sashahilton00 commented Nov 16, 2016

When creating a new consumer through Konga, followed by creating a new API key for the key-auth plugin, Konga crashes due to the consumer.credentials object being undefined. Below is the loggin output:

<- POST /kong/consumers/9dd4179e-aa4a-433d-bcc8-b5d92f87c25d/key-auth (98ms 200) [0] /Users/sashahilton/Documents/D2D/konga/backend/api/services/ConsumerCredentialsService.js:15 [0] consumer.credentials.push(credential) [0] ^ [0] [0] TypeError: Cannot read property 'push' of undefined [0] at /Users/sashahilton/Documents/D2D/konga/backend/api/services/ConsumerCredentialsService.js:15:37

The problem is also present on the other API credential methods.

@sashahilton00
Copy link
Contributor Author

Great work btw, this is by far the best open UI for Kong, can't understand why it isn't mentioned more :)

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

Hey, @sashahilton00
I've published a version in a hurry and broke some consumer related stuff... Later today a new version of Konga will be published fixing all those issues.

Thanks for the kind words :)
Konga is a relative new addition to Kong's community, I'm working on it less than a month, changing , adding and breaking things all the time :).

Because of that i haven't been able to advertise it as much as i would like:).

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

@sashahilton00
I've just pushed a new version that fixes the issue you mentioned among other things.
I'm gonna leave this issue open for a couple of days in case you'd like to test and confirm the resolution yourself.

Cheers 👍

@pantsel pantsel closed this as completed Nov 16, 2016
@pantsel pantsel reopened this Nov 16, 2016
@sashahilton00
Copy link
Contributor Author

Will test it now, thanks @pantsel :)

@sashahilton00
Copy link
Contributor Author

@pantsel have you changed anything to do with the routing? The reason I ask is because Konga is unusable for me not, as the view either goes to the /settings view regardless of what I click, or it refreshes the /dashboard endpoint hundreds of times a second. Have attached a link to a video so you can see what I mean:

https://www.dropbox.com/s/8s0v5w6d22f7bqi/File%2016-11-2016%2C%2022%2004%2008.mov?dl=0

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

Try to begin with a clean install. Clear your browsers local storage and delete the localDiskDb.db file from /backend/.tmp.

I've changed the User model schema and some routing stuff that may be related with this issue.

@sashahilton00
Copy link
Contributor Author

I did run a fresh install but perhaps the browser cache is the problem. Will reinstall and wipe cache and let you know in a moment if it works or not.

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

@sashahilton00 ,
konga is intentionally redirecting you to settings if you haven't activated a node to work with. When running Konga for the first time, the node 127.0.0.1:8001 is created but it is disabled by default. If you're running kong admin API at 127.0.0.1:8001, you will need to click the star icon and enable the default node before browsing other sections.

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

Nevertheless, the infinite refreshing glitch should not happen...

@sashahilton00
Copy link
Contributor Author

I literally just discovered that there was no active node as your reply came through, and hit the star button. Might it be a good idea to display a notification to the user about activating a node or having the default node active by default? Also, when there is no active node, the /dashboard endpoint has the problem I mentioned in the previous post, though I'm not sure that is really a huge issue.

@sashahilton00
Copy link
Contributor Author

Nevertheless, I just added a brief note to the Readme about activating the node in case anyone else has the same issue.

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

I've put an alert on top of the nodes list in settings, stating that you need to create one or more nodes and select the node to connect to by clicking on the corresponding star icon. If the alert is obscure or doesn't states the point sufficiently, then I might as well pop a notification or something..

@sashahilton00
Copy link
Contributor Author

Ok, will pull now and check that the original issue has been fixed. On a side note, when changing the password for the user in Konga, the password is logged to console. Not sure if this is expected behaviour since I'm running in developer mode, or just oversight. Anyway, thanks for pushing out the fix so quickly :) Will test now.

@pantsel
Copy link
Owner

pantsel commented Nov 16, 2016

In production all debug logs must be disabled all together from angular

.config(function($logProvider){
  $logProvider.debugEnabled(false);
});

I haven't applied that yet to gulp automations. It's one of the things i will do as soon as possible.

@sashahilton00
Copy link
Contributor Author

Ah right, not to worry, I'm not saving the logs anyway :) I can confirm the original issue is fixed as well. On a closing note, does this repo have a Gitter chatroom or something? That way one can avoid conversations in issue trackers :)

hainguyen8y pushed a commit to hainguyen8y/konga that referenced this issue Aug 19, 2022
* Bump socket.io-redis from 1.0.0 to 6.1.1

Bumps [socket.io-redis](https://github.com/socketio/socket.io-redis) from 1.0.0 to 6.1.1.
- [Release notes](https://github.com/socketio/socket.io-redis/releases)
- [Changelog](https://github.com/socketio/socket.io-redis-adapter/blob/6.1.1/CHANGELOG.md)
- [Commits](socketio/socket.io-redis-adapter@1.0.0...6.1.1)

---
updated-dependencies:
- dependency-name: socket.io-redis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump socket.io-redis to 1.1.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fabasoad <fabasoad@gmail.com>
aaronrumao referenced this issue in DigitalAssetPortal/konga Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants