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

Admin page shows blank. #388

Open
hcmuleva opened this issue Apr 2, 2017 · 2 comments
Open

Admin page shows blank. #388

hcmuleva opened this issue Apr 2, 2017 · 2 comments

Comments

@hcmuleva
Copy link

hcmuleva commented Apr 2, 2017

Hi,
I have metero sample application and I would like to see tables and charts of these application.
Steps which I have performed are as follows:
Step1: created a sample app in meteor using meteor create --full myApp.
Step2: I modify the code to use IronRouter
Step3: included account packages so that I can create user and login into app
step4: included houston:admin package in myApp
step5: restarted myApp and login into app. Now when I give url localhost/admin
it does not sow any collections and also debug console show below errror
meteor.js:930 Exception in callback of async function: Error: Handler with name 'hookWithOptions' already exists.
at MiddlewareStack.create (http://localhost:3000/packages/iron_middleware-stack.js?hash=f7f42efd36f6c9b9761b5c65fab107b7d5a19d35:200:13)
at MiddlewareStack.push (http://localhost:3000/packages/iron_middleware-stack.js?hash=f7f42efd36f6c9b9761b5c65fab107b7d5a19d35:216:22)
at http://localhost:3000/packages/iron_middleware-stack.js?hash=f7f42efd36f6c9b9761b5c65fab107b7d5a19d35:234:12
at Array.forEach (native)
at Function.
.each..forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149:11)
at MiddlewareStack.append (http://localhost:3000/packages/iron_middleware-stack.js?hash=f7f42efd36f6c9b9761b5c65fab107b7d5a19d35:230:5)
at http://localhost:3000/packages/iron_middleware-stack.js?hash=f7f42efd36f6c9b9761b5c65fab107b7d5a19d35:236:19
at Array.forEach (native)
at Function.
.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149:11)
at MiddlewareStack.append (http://localhost:3000/packages/iron_middleware-stack.js?hash=f7f42efd36f6c9b9761b5c65fab107b7d5a19d35:230:5)
meteor.js:930 Exception in template helper: ReferenceError: Session is not defined
at Object.Houston._session (http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:1114:12)
at Object.err (http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:1261:20)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3051:16
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1715:16
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3103:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744:12)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3102:27
at Object.Spacebars.call (http://localhost:3000/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:172:18)
at http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:700:26
at Blaze.View. (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2734:44)
meteor.js:930 Exception in template helper: ReferenceError: Session is not defined
at Object.Houston._session (http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:1114:12)
at Object.show (http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:1264:20)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3051:16
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1715:16
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3103:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744:12)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3102:27
at Object.Spacebars.call (http://localhost:3000/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:172:18)
at http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:706:26
at Blaze.View. (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2734:44)
meteor.js:930 Exception in template helper: ReferenceError: Session is not defined
at Object.Houston._session (http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:1114:12)
at Object.message (http://localhost:3000/packages/houston_admin.js?hash=1b62e7a5df64f30ef2793127dc133cadcc3e81c9:1267:20)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3051:16
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1715:16
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3103:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744:12)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3102:27
at Spacebars.call (http://localhost:3000/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:172:18)
at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:106:25)
at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:110:39)
Thanks!

@chan71
Copy link

chan71 commented Jun 8, 2017

I had faced the same error upon accessing http://localhost/admin after houston is installed to view mongodb collections.

When I ran meteor add houston:admin number of iron packages were updated including iron:middleware-stack to 1.0.11. This wasn't good enough though.

Changes to your projects package version selections:

dburles:mongo-collection-instances  added, version 0.3.4
houston:admin                       added, version 2.0.7
iron:controller                     added, version 1.0.12
iron:core                           added, version 1.0.11
iron:dynamic-template               added, version 1.0.12
iron:layout                         added, version 1.0.12
iron:location                       added, version 1.0.11
iron:middleware-stack               added, version 1.0.11
iron:router                         added, version 1.0.12
iron:url                            added, version 1.0.11
lai:collection-extensions           added, version 0.1.4
tmeasday:paginated-subscription     added, version 0.2.4

houston:admin: A zero-config Meteor Admin

After I ran meteor update iron:middleware-stack as suggested here and the admin page was shown.
This time,

Changes to your projects package version selections from updating package versions:
iron:middleware-stack  upgraded from 1.0.11 to 1.1.0

@tomvolek
Copy link

tomvolek commented Sep 5, 2017

I am assuming you are using the accounts package.
In case the above thosn't work. And assuming you Try this:

  1. Remove the Houston package meteor remove Houston package : meteor remvoe houston:admin
  2. Use a mongo collection management tool like Robomongo or login to Mongo DB on command line and Drop the two Houston collections called "houston_collections" and "houston_admins".
  3. Login to your application with the user Id you have designated to be admin and go to the /admin url . Now you will see the message "You are not an Admin. If you need to use the Houston Admin, please ask your Admin to grant you access." . You will see a button saying "Claim Admin" press it and it will add the current logged in user to the Houston-admins collection in Mongo and you will be redirected to the Houston /admin page .

The root cause is this check in the code :
https://github.com/gterrono/houston/blob/master/client/admin_login.html Line 4, the currentUserIsAdmin doesn not return true.

Hope this Helps
Tom

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

3 participants