These are chat archives for fossasia/open-event-server

28th
Apr 2018
Bhavesh Anand
@bhaveshAn
Apr 28 2018 08:16 UTC
Deploying the project to kubernetes cluster
namespace "kube-lego" created
configmap "kube-lego" created
deployment "kube-lego" created
namespace "nginx-ingress" created
configmap "nginx" created
deployment "default-http-backend" created
service "default-http-backend" created
deployment "nginx" created
service "nginx" created
namespace "redis" created
deployment "redis" created
service "redis" created
namespace "elasticsearch" created
serviceaccount "elasticsearch" created
configmap "elasticsearch" created
deployment "elasticsearch" created
service "elasticsearch" created
namespace "postgres" created
configmap "postgres" created
deployment "postgres" created
service "postgres" created
Waiting for postgres to startup. Will start in ~30s.
namespace "web" created
ingress "web-notls" created
ingress "web" created
configmap "api-server" created
deployment "api-server" created
service "api-server" created
Waiting for server to start up. ~30s.
Done. The project was deployed to kubernetes. :)
For Deployment on Google Container Engine (Kubernetes)
this is coming but domain is not responding. Help Please.
Harsimar
@simarsingh24
Apr 28 2018 08:20 UTC
Did you check your gcloud errror reporting? What does it say?
Bhavesh Anand
@bhaveshAn
Apr 28 2018 08:21 UTC
 InvalidDsn: Invalid Sentry DSN: 'https://dummy@app.getsentry.com/dummy'
from_string (/usr/local/lib/python2.7/site-packages/raven/conf/remote.py)
Harsimar
@simarsingh24
Apr 28 2018 08:21 UTC
You have to make a account on sentry
And link the DSN
Screen Shot 2018-04-27 at 6.44.11 PM.png
This is the error i faced after linking the DSN, ( changed DSN entry in yams/api-server/configmap.yml )
Bhavesh Anand
@bhaveshAn
Apr 28 2018 08:48 UTC
ok
Saurabh Chaturvedi
@schedutron
Apr 28 2018 18:13 UTC
For accessing the API, I need the JWT access token. The docs say "Once you have registered yourself as an user, you can send a request to get the access_token." But to send the request of registering as a user (creating a user), I need the access_token itself.
So how do I obtain the access token?
Bhavesh Anand
@bhaveshAn
Apr 28 2018 18:14 UTC
did you made post to /auth/session using attributes email and password
Saurabh Chaturvedi
@schedutron
Apr 28 2018 18:50 UTC
That gives an error:

```Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1997, in call
return self.wsgi_app(environ, start_response)
File "/Users/binaryboy/Desktop/open-event-server/app/init.py", line 71, in call
return self.app(environ, start_response)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(args, **kwargs)))
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(
args, kwargs)))
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](
req.view_args)
File "/usr/local/lib/python2.7/site-packages/flask_jwt/init.py", line 115, in _default_auth_request_handler
username = data.get(current_app.config.get('JWT_AUTH_USERNAME_KEY'), None)
AttributeError: 'NoneType' object has no attribute 'get'

```

Sorry for the bad format, here is the proper traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/binaryboy/Desktop/open-event-server/app/__init__.py", line 71, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/site-packages/flask_jwt/__init__.py", line 115, in _default_auth_request_handler
    username = data.get(current_app.config.get('JWT_AUTH_USERNAME_KEY'), None)
AttributeError: 'NoneType' object has no attribute 'get'
Saurav Tiwary
@srv-twry
Apr 28 2018 19:20 UTC
@schedutron You don't need a JWT token for creating a user. The sample request in the API docs seem to be wrong
Mayank Vaidya
@mayank8318
Apr 28 2018 19:20 UTC
:+1:
Saurav Tiwary
@srv-twry
Apr 28 2018 19:20 UTC
You only need the Content-Type header in your API request
Please create an issue in the server repository and fix it if you want otherwise i will do it :smile:
Saurabh Chaturvedi
@schedutron
Apr 28 2018 20:00 UTC
@srv-twry Alright, I'll file the issue and fix it :smiley:
Saurabh Chaturvedi
@schedutron
Apr 28 2018 20:29 UTC
I made a sample user data payload and posted it without the access token, now it says Invalid credentials:
>>> headers
{'Content-Type': 'application/vnd.api+json'}
>>> r = requests.post('http://localhost:5000/auth/session', headers=headers, data=json.dumps(payload))
>>> r.json()
{u'status_code': 401, u'description': u'Invalid credentials', u'error': u'Bad Request'}
>>>
Saurav Tiwary
@srv-twry
Apr 28 2018 20:40 UTC
  1. register your user with email and password. It won't need the token
  1. Now hit the session endpoint with the registered email and password
use the returned token now
use tools like postman for making api calls