Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cand add new connection #136

Closed
lorintotahh opened this issue Nov 22, 2017 · 15 comments
Closed

Cand add new connection #136

lorintotahh opened this issue Nov 22, 2017 · 15 comments

Comments

@lorintotahh
Copy link

I start konga
then


Using postgres DB Adapter.
`konga_database` database exists. Continue...
debug: Hook:api_health_checks:process() called
debug: Hook:health_checks:process() called
debug: Hook:start-scheduled-snapshots:process() called
debug: Hook:user_events_hook:process() called
debug: User had models, so no seed needed
debug: Kongnode had models, so no seed needed
debug: Emailtransport seeds updated
debug: -------------------------------------------------------
debug: :: Wed Nov 22 2017 16:50:35 GMT+0200 (IST)
debug: Environment : development
debug: Port        : 1337
debug: -------------------------------------------------------

now in the dashboard page where is
'First of all, lets setup a connection to Kong Admin.'
i define name and URL click on create connection and nothing happen...

@pantsel
Copy link
Owner

pantsel commented Nov 22, 2017

Hi @lorintotahh , open the javascript console and copy here what you see.

@stackedsax
Copy link

stackedsax commented Dec 5, 2017

@lorintotahh I'm seeing the same issue that you are. I've tried a couple different versions of konga and no luck with creating a connection the regular way.

Instead, if you're just testing this out, you can do this:

the local db is stored in kongadata/konga.db... just json
edited the default connection to what I want... everything else seems to work

  • open up kongadata/konga.db
  • find "konga_kong_nodes"
  • edit "kong_admin_url" with your admin url
  • restart konga with npm start
  • instead of creating a new connection, go to the "connections" menu item on the left
  • click the star icon by the default connection you just edited in the db.

As for the bug, it's definitely real for me. Here's what I tried:

  • OSX 10.12.6
  • Google Chrome 62.0.3202.94
  • npm version 5.5.1
  • docker for mac 17.09.0

My steps:

  • pull the docker image and spin it up
  • I go to localhost:1337 in my browser
  • Konga asks me to sign up. I fill out the form
  • I am presented with a page to create a new connection. I fill out the details and click the button.

The button spins for a millisecond and does nothing.

Next:

  • I grabbed the source
  • Installed the prerequisites
  • npm start
  • I go to localhost:1338 in my browser
  • Konga asks me to sign up. I fill out the form
  • I am presented with a page to create a new connection. I fill out the details and click the button.

The button spins for a millisecond and does nothing.

In terms of what I see in the javascript console, it's nothing. Nada, zero, zilch. There's nothing in the network panel for any XHR requests. Just, nothing happens.

If I look really closely, I can inspect the 'create connection' button itself and when I click it there is some very slight js activity when the button flashes a spinning icon and some elements get rewritten for a split-second, and then they return to their original state.

As a side-note, curl and kong-dashboard both connect to my admin url just fine.

@stackedsax
Copy link

One more thing: now that I hacked the db and made myself an admin, I have no problem adding a new connection.

@pantsel
Copy link
Owner

pantsel commented Dec 5, 2017

@stackedsax ,

the connection creation issue is fixed in this commit.

The demo instance is using the latest version and as you can see the connections can be managed just fine.

@stackedsax
Copy link

Yep, I'm most definitely running with that commit -- I pulled the code earlier today.

Just to double-check, I'm looking directly at the code right now in my other monitor and it matches what should be in create-connection-form-flat.html and 02_dashboard-controller.js.

I guess I'm suggesting that some part of this issue persists.

@pantsel
Copy link
Owner

pantsel commented Dec 5, 2017

Since i cannot reproduce it at my local env nor the live demo env (that you can check for yourself), i'm assuming it has something to do with your env.

Try restarting konga and kong and log out and in again.

@pantsel
Copy link
Owner

pantsel commented Dec 5, 2017

Oh yes, try hard refreshing your page as well. It's common that the browser cached the old code since the actual app version has not changed.

@stackedsax
Copy link

Hard-refreshing didn't help any.

Plus, I didn't have any old code because I only started testing konga a couple days ago. I only checked out the code after this fix was in.

This seems to be a problem only with a really, really fresh checkout of the code. As soon as I have one working connection everything works fine -- and that includes creating more connections. The demo environment already has a working connection so it's not a good representation of the problem. I don't know about your local dev environment, but I'm guessing it already has some connections, too, so it won't reproduce the issue.

I just verified that this happens elsewhere by taking a totally different laptop, checking out konga again, and running the docker container. The exact same issue happens.

Thanks for your time on this!

@pantsel
Copy link
Owner

pantsel commented Dec 6, 2017

@stackedsax , are you using a specific database or the default one? I will run some more tests on other machines as well and let you know.

@pantsel
Copy link
Owner

pantsel commented Dec 6, 2017

@stackedsax , maaaaaaan...

I just realized your problem after seeing your messages on gitter.

I never could of thought that that was the case.
My fault tho, due to lack of documentation and proper UI handling. That will be addressed.

Ok so, you're spinning a brand new Konga instance, you sign up and from there a connection can;t be created,

That's intended,

By default, a new user has only minimal permissions. And managing connections is not one of them.
So a new user with the default configuration, cannot actually create a new connection.

What you should on first launch is:

  1. Login as admin with the default credentials (admin, adminadminadmin)
  2. Create your connections.
  3. Setup the application by messing with the settings in the SETTINGS page. There you can mess with normal user ACLs as well.
  4. Rule of thumb is to change the default admin credentials as well,

@stackedsax
Copy link

ahhhh, of course! well, at least I'm not totally crazy!

In a sense, I did exactly what you're suggesting, except that I went into the localdb and raised my newly-created user to the status of admin.

I would maybe have realized that I needed to login with the admin user a little faster had I not been prompted to create a user when I first brought up the app. You DO have the default admin username and password in the README, but I figured the app was leading me through the steps I needed to take and didn't think too deeply about it once I was in the app.

Thanks for the explanation, though!

@RokitSalad
Copy link

Just got caught out with the same thing. I was very close to abandoning konga because it seemed as thought it wasn't stable enough.

I'd really suggest fixing the 'completely fresh install' experience.

@closertotheend
Copy link

Try to connect via: http://172.17.0.1:8001 - it worked for me instead of localhost, I had lost too many hours for finding that

@debu99
Copy link
Contributor

debu99 commented Jan 3, 2020

add admin_listen=0.0.0.0:8001, 0.0.0.0:8444 ssl into kong.conf

@pranav-sharma26
Copy link

In Mac, while creating the connection, if you are getting error: connection can't be created.

give http://host.docker.internal:8001 in Kong admin url. It will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants