Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Error While Creating A New User #1036

Open
sujoyroyskr opened this issue Apr 13, 2018 · 3 comments
Open

Error While Creating A New User #1036

sujoyroyskr opened this issue Apr 13, 2018 · 3 comments
Labels

Comments

@sujoyroyskr
Copy link

Error loading resource from API. Error: <HTTP 500: <title>TypeError: super() argument 1 must be type, not None // Werkzeug Debugger</title> <script src="?__debugger__=yes&cmd=resource&f=jquery.js"></script> <script src="?__debugger__=yes&cmd=resource&f=debugger.js"></script> <script type="text/javascript"> var TRACEBACK = 140463767173840, CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = "mxtYyqMilon2Op6Tk0JW"; </script>

TypeError

TypeError: super() argument 1 must be type, not None

Traceback (most recent call last)

  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1997, in call

     error = None
     ctx.auto_pop(error)
     
     def call(self, environ, start_response):
     """Shortcut for :attr:wsgi_app."""
     return self.wsgi_app(environ, start_response)
     
     def repr(self):
     return '<%s %r>' % (
     self.class.name,
     self.name,
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app

     try:
     try:
     response = self.full_dispatch_request()
     except Exception as e:
     error = e
     response = self.handle_exception(e)
     except:
     error = sys.exc_info()[1]
     raise
     return response(environ, start_response)
     finally:
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router

     if self._has_fr_route():
     try:
     return self.handle_error(e)
     except Exception:
     pass # Fall through to original handler
     return original_handler(e)
     
     def handle_error(self, e):
     """Error handler for the API transforms a raised exception into a Flask
     response, with the appropriate HTTP status code and body.
     
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router

     if self._has_fr_route():
     try:
     return self.handle_error(e)
     except Exception:
     pass # Fall through to original handler
     return original_handler(e)
     
     def handle_error(self, e):
     """Error handler for the API transforms a raised exception into a Flask
     response, with the appropriate HTTP status code and body.
     
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception

     # if we want to repropagate the exception, we can attempt to
     # raise it with the whole traceback in case we can do that
     # (the function was actually called from the except part)
     # otherwise, we just raise the error again
     if exc_value is e:
     reraise(exc_type, exc_value, tb)
     else:
     raise e
     
     self.log_exception((exc_type, exc_value, tb))
     if handler is None:
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 270, in error_router

     :type e: Exception
     
     """
     if self._has_fr_route():
     try:
     return self.handle_error(e)
     except Exception:
     pass # Fall through to original handler
     return original_handler(e)
     
     def handle_error(self, e):
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app

     ctx = self.request_context(environ)
     ctx.push()
     error = None
     try:
     try:
     response = self.full_dispatch_request()
     except Exception as e:
     error = e
     response = self.handle_exception(e)
     except:
     error = sys.exc_info()[1]
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request

     request_started.send(self)
     rv = self.preprocess_request()
     if rv is None:
     rv = self.dispatch_request()
     except Exception as e:
     rv = self.handle_user_exception(e)
     return self.finalize_request(rv)
     
     def finalize_request(self, rv, from_error_handler=False):
     """Given the return value from a view function this finalizes
     the request by converting it into a response and invoking the
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router

     if self._has_fr_route():
     try:
     return self.handle_error(e)
     except Exception:
     pass # Fall through to original handler
     return original_handler(e)
     
     def handle_error(self, e):
     """Error handler for the API transforms a raised exception into a Flask
     response, with the appropriate HTTP status code and body.
     
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router

     if self._has_fr_route():
     try:
     return self.handle_error(e)
     except Exception:
     pass # Fall through to original handler
     return original_handler(e)
     
     def handle_error(self, e):
     """Error handler for the API transforms a raised exception into a Flask
     response, with the appropriate HTTP status code and body.
     
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception

     return self.handle_http_exception(e)
     
     handler = self._find_error_handler(e)
     
     if handler is None:
     reraise(exc_type, exc_value, tb)
     return handler(e)
     
     def handle_exception(self, e):
     """Default exception handling that kicks in when an exception
     occurs that is not caught. In debug mode the exception will
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 270, in error_router

     :type e: Exception
     
     """
     if self.has_fr_route():
     try:
     return self.handle_error(e)
     except Exception:
     pass # Fall through to original handler
     return original_handler(e)
     
     def handle_error(self, e):
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request

     self.try_trigger_before_first_request_functions()
     try:
     request_started.send(self)
     rv = self.preprocess_request()
     if rv is None:
     rv = self.dispatch_request()
     except Exception as e:
     rv = self.handle_user_exception(e)
     return self.finalize_request(rv)
     
     def finalize_request(self, rv, from_error_handler=False):
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request

     # request came with the OPTIONS method, reply automatically
     if getattr(rule, 'provide_automatic_options', False) </pre> 
     and req.method == 'OPTIONS':
     return self.make_default_options_response()
     # otherwise dispatch to the handler for that endpoint
     return self.view_functionsrule.endpoint
     
     def full_dispatch_request(self):
     """Dispatches the request and on top of that performs request
     pre and postprocessing as well as HTTP exception catching and
     error handling.
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 480, in wrapper

     
     :param resource: The resource as a flask view function
     """
     @wraps(resource)
     def wrapper(*args, **kwargs):
     resp = resource(*args, **kwargs)
     if isinstance(resp, ResponseBase): # There may be a better way to test
     return resp
     data, code, headers = unpack(resp)
     return self.make_response(data, code, headers=headers)
     return wrapper
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/views.py", line 84, in view

     The arguments passed to :meth:as_view are forwarded to the
     constructor of the class.
     """
     def view(*args, **kwargs):
     self = view.view_class(*class_args, **class_kwargs)
     return self.dispatch_request(*args, **kwargs)
     
     if cls.decorators:
     view.name = name
     view.module = cls.module
     for decorator in cls.decorators:
  • File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 595, in dispatch_request

     decorators = self.method_decorators
     
     for decorator in decorators:
     meth = decorator(meth)
     
     resp = meth(*args, **kwargs)
     
     if isinstance(resp, ResponseBase): # There may be a better way to test
     return resp
     
     representations = self.representations or OrderedDict()
  • File "/home/sujoy/projects/threatalert/security_monkey/views/tech_methods.py", line 76, in get

     
     for key in auditor_registry.keys():
     methods = []
     
     for auditor_class in auditor_registry[key]:
     auditor = auditor_class('')
     for method_name in dir(auditor):
     method_name = method_name + ' (' + auditor.class.name + ')'
     if (method_name.find("check")) == 0:
     methods.append(method_name)
     
  • File "/home/sujoy/projects/threatalert/security_monkey/auditors/iam/iam_user.py", line 39, in init

     i_am_singular = IAMUser.i_am_singular
     i_am_plural = IAMUser.i_am_plural
     support_auditor_indexes = [ManagedPolicy.index]
     
     def init(self, accounts=None, debug=False):
     super(IAMUserAuditor, self).init(accounts=accounts, debug=debug)
     self.iam_policy_keys = ['InlinePolicies$*']
     
     def prep_for_audit(self):
     """
     Prepare for the audit by calculating 90 days ago.
TypeError: super() argument 1 must be type, not None

This is the Copy/Paste friendly version of the traceback. You can also paste this traceback into a gist:

<textarea cols="50" rows="10" name="code" readonly>Traceback (most recent call last): File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1997, in call return self.wsgi_app(environ, start_response) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router return original_handler(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router return original_handler(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 270, in error_router return self.handle_error(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router return original_handler(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 273, in error_router return original_handler(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 270, in error_router return self.handle_error(e) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 480, in wrapper resp = resource(*args, **kwargs) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) File "/home/sujoy/virtual_envs/security_monkey/lib/python2.7/site-packages/flask_restful/init.py", line 595, in dispatch_request resp = meth(*args, **kwargs) File "/home/sujoy/projects/threatalert/security_monkey/views/tech_methods.py", line 76, in get auditor = auditor_class('') File "/home/sujoy/projects/threatalert/security_monkey/auditors/iam/iam_user.py", line 39, in init super(IAMUserAuditor, self).init(accounts=accounts, debug=debug) TypeError: super() argument 1 must be type, not None</textarea>
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.
Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.

Console Locked

The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server.

PIN:

>

@naggappan
Copy link
Contributor

@sujoyroyskr can you please give the following informations,

  • First user you have to create using monkey add_account command not from UI
  • Did you used monkey add_account ?
  • How did you installed the SM, which document have you followed (docker or aws launch instance method or standard dev environment )
  • check if following 3 service are running?
    • API (monkey runserver)
    • Scheduler (ps -aux |grep celerybead-scheduler)
    • worker (ps -aux |grep celerybeat-worker)

@mikegrima
Copy link
Contributor

@sujoyroyskr Can you please reformat your output? It's not readable.

Also, can you provide details on what actions you are performing to reproduce the error?

@sujoyroyskr
Copy link
Author

sujoyroyskr commented Apr 19, 2018

Previous Error Resolved....... Thank You @naggappan @mikegrima for the consideration

I created a new page for adding new email (created its dart file also)
But I am still not able to add New Email... Looking For Some Help

Here are the codes for both HTML and dart:-

HTML File

{{err_message}}

Loading. . .

Edit Users

Add New Users

E-mail
        <div class="form-group">
      <label
         for="password"
         class="col-sm-2 control-label"
         tooltip-placement="right"
         tooltip="Enter Your Password">
         Password
      </label>
        <div class="col-sm-10">
          <input
            type="text"
            class="form-control"
            id="password"
            placeholder="Enter Your Password"
            ng-model="userentry.password"
            maxlength="512"
            tooltip-placement="left"
            tooltip="Enter Your Password">
        </div>
      </div>

      <div class="form-group">
      <label
         for="role"
         class="col-sm-2 control-label"
         tooltip-placement="right"
         tooltip="Enter Your Role">
         Role
      </label>
        <div class="col-sm-10">
          <input
            type="text"
            class="form-control"
            id="role"
            placeholder="Enter Your Role"
            ng-model="userentry.role"
            maxlength="512"
            tooltip-placement="left"
            tooltip="Enter Your Role">
        </div>
      </div>


      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button
                  type="submit"
                  class="btn btn-primary"
                  ng-click="saveEntry()">
              Save
          </button>
        </div>
      </div>
    </form>
    </div>
  </div>
</div>

Dart File:-

part of security_monkey;

@component(
selector: 'userview',
templateUrl: 'packages/security_monkey/component/user_add_component/user_add_component.html',
//cssUrl: const ['/css/bootstrap.min.css']
useShadowDom: false
)
class UserViewComponent implements ScopeAware {
RouteProvider routeProvider;
Router router;
User userentry;
PasswordEntry password;
bool create = false;
bool _as_loaded = false;
bool _is_error = false;
String err_message = "";
ObjectStore store;

UserViewComponent(this.routeProvider, this.router, this.store) {
    this.store = store;
        userentry = new User();
        create = true;
}

void set scope(Scope scope) {
    scope.on("globalAlert").listen(this._showMessage);
}

get isLoaded => create || _as_loaded;
get isError => _is_error;

void _showMessage(ScopeEvent event) {
    this._is_error = true;
    this.err_message = event.data;
}

void saveEntry() {
    if (create) {
        this.store.create(this.userentry).then((CommandResponse r) {
            int id = r.content['id'];
            router.go('viewuser', {
                'userentryid': id
            });
        });
    }

    else {
        print("ID: ${this.userentry.id}");
        this.store.update(this.userentry).then( (_) {
            _as_loaded = false;
            store.one(User, routeProvider.parameters['userentryid']).then((userentry) {
                this.userentry = userentry;
                _as_loaded = true;
            });
        });
    }

}

void deleteEntry() {
    this.store.delete(this.userentry).then((_) {
        router.go('settings', {});
    });
}



void reload() {
    _as_loaded = false;
    _as_loaded = true;
}

}

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

No branches or pull requests

3 participants