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

New Install - Internal project (id=1) does not exist #4095

Closed
lukepolo opened this issue Sep 8, 2016 · 7 comments
Closed

New Install - Internal project (id=1) does not exist #4095

lukepolo opened this issue Sep 8, 2016 · 7 comments

Comments

@lukepolo
Copy link

@lukepolo lukepolo commented Sep 8, 2016

Clean install , on a empty ubuntu 16.04 server.

Using docker install

postgres:9.5
redis:3.2-alpine

I did not modify any config settings only set a secret

docker run \
>   --rm \
>   --link sentry-redis:redis \
>   --link sentry-postgres:postgres \
>   --link sentry-smtp:smtp \
>   --env SENTRY_SECRET_KEY=$SENTRY_SECRET_KEY \
>   --name sentry-web-01 \
>   -p 9000:9000 \
>   sentry-onpremise \
>   run web
*** Starting uWSGI 2.0.13.1 (64bit) on [Thu Sep  8 15:04:01 2016] ***
compiled with version: 4.9.2 on 31 August 2016 04:15:20
os: Linux-4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016
nodename: 231c7db93dbe
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /usr/src/sentry
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your memory page size is 4096 bytes
detected max file descriptor number: 65536
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to TCP address 0.0.0.0:9000 fd 3
Python version: 2.7.12 (default, Aug 31 2016, 02:40:39)  [GCC 4.9.2]
Set PythonHome to /usr/local
Python main interpreter initialized at 0x17a04a0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
setting request body buffering size to 65536 bytes
mapped 1922048 bytes (1877 KB) for 12 cores
*** Operational MODE: preforking+threaded ***
spawned uWSGI master process (pid: 10)
spawned uWSGI worker 1 (pid: 15, cores: 4)
spawned uWSGI worker 2 (pid: 16, cores: 4)
spawned uWSGI worker 3 (pid: 17, cores: 4)
WSGI app 0 (mountpoint='') ready in 7 seconds on interpreter 0x17a04a0 pid: 16 (default app)
WSGI app 0 (mountpoint='') ready in 7 seconds on interpreter 0x17a04a0 pid: 15 (default app)
WSGI app 0 (mountpoint='') ready in 7 seconds on interpreter 0x17a04a0 pid: 17 (default app)
12.2.45.109 - - [08/Sep/2016:15:04:08 +0000] "GET / HTTP/1.1" 302 437 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
15:04:11 [ERROR] sentry.errors: Internal project (id=1) does not exist
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 175, in dispatch
    return self.handle(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/transaction.py", line 371, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 146, in handle
    org = Organization.get_default()
  File "/usr/local/lib/python2.7/site-packages/sentry/models/organization.py", line 109, in get_default
    )[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
15:04:11 [ERROR] django.request: Internal Server Error: /auth/login/ (status_code=500 request=<WSGIRequest
path:/auth/login/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'sentrysid': 'gAJ9cQFVBV9uZXh0WAEAAAAvcy4:1bi0s5:vtkuT8ufwo0Na0O4fJqcZ0DegFs'},
META:{u'CSRF_COOKIE': u'57ratSWBwOB4V0CPgySO71g9mjRZKoNq',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, sdch',
 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8,vi;q=0.6,fr;q=0.4',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'sentrysid="gAJ9cQFVBV9uZXh0WAEAAAAvcy4:1bi0s5:vtkuT8ufwo0Na0O4fJqcZ0DegFs"',
 'HTTP_HOST': '104.236.106.131:9000',
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
 'PATH_INFO': u'/auth/login/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '12.2.45.109',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/auth/login/',
 'SCRIPT_NAME': u'',
 'SERVER_NAME': '231c7db93dbe',
 'SERVER_PORT': '9000',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'uwsgi.core': 0,
 'uwsgi.node': '231c7db93dbe',
 'uwsgi.version': '2.0.13.1',
 'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x7f856714fed0>,
 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
 'wsgi.input': <uwsgi._Input object at 0x7f856717c108>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/error_500.py", line 23, in get_embed_config
    )[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
15:04:11 [ERROR] root: Unable to fetch ProjectKey for internal project
15:04:11 [ERROR] sentry.errors: Internal project (id=1) does not exist
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/templatetags/sentry_react.py", line 65, in _get_public_dsn
    )[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
15:04:11 [ERROR] root: Unable to fetch ProjectKey for internal project
15:04:11 [ERROR] sentry.errors: Internal project (id=1) does not exist

Also mabye some relevant information : When running upgrade, it would stall then bail out. had to run upgrade 3 times before it would finish. Also never asked to create a user

@mattrobenolt

This comment has been minimized.

Copy link
Member

@mattrobenolt mattrobenolt commented Sep 8, 2016

It's definitely because something during upgrade didn't work correctly. Anytime I've heard of that "stalling out" was because the process didn't have enough memory available.

@lukepolo

This comment has been minimized.

Copy link
Author

@lukepolo lukepolo commented Sep 8, 2016

yup, just upgraded the server, worked fine.

@thamaraiselvam

This comment has been minimized.

Copy link

@thamaraiselvam thamaraiselvam commented Nov 7, 2016

@lukepolo i got same issue

root@ip:/home/ubuntu/onpremise# docker run --rm --link sentry-redis:redis --link sentry-postgres:postgres --link sentry-smtp:smtp --env SENTRY_SECRET_KEY="key" --name sentry-web-01 -p 9000:9000 sentry-onpremise run web
*** Starting uWSGI 2.0.14 (64bit) on [Mon Nov  7 09:46:03 2016] ***
compiled with version: 4.9.2 on 02 November 2016 20:05:03
os: Linux-3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016
nodename: cfc930779cc8
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /usr/src/sentry
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 524288
your memory page size is 4096 bytes
detected max file descriptor number: 524288
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to TCP address 0.0.0.0:9000 fd 3
Python version: 2.7.12 (default, Oct 31 2016, 23:50:21)  [GCC 4.9.2]
Set PythonHome to /usr/local
Python main interpreter initialized at 0xa296b0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
setting request body buffering size to 65536 bytes
mapped 1922048 bytes (1877 KB) for 12 cores
*** Operational MODE: preforking+threaded ***
spawned uWSGI master process (pid: 12)
spawned uWSGI worker 1 (pid: 17, cores: 4)
spawned uWSGI worker 2 (pid: 18, cores: 4)
spawned uWSGI worker 3 (pid: 19, cores: 4)
WSGI app 0 (mountpoint='') ready in 5 seconds on interpreter 0xa296b0 pid: 17 (default app)
WSGI app 0 (mountpoint='') ready in 5 seconds on interpreter 0xa296b0 pid: 18 (default app)
WSGI app 0 (mountpoint='') ready in 5 seconds on interpreter 0xa296b0 pid: 19 (default app)
09:46:08 [ERROR] sentry.errors: Internal project (id=1) does not exist
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 186, in dispatch
    return self.handle(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/transaction.py", line 371, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 140, in handle
    org = Organization.get_default()
  File "/usr/local/lib/python2.7/site-packages/sentry/models/organization.py", line 117, in get_default
    )[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
09:46:08 [ERROR] django.request: Internal Server Error: /auth/login/ (status_code=500 request=<WSGIRequest
path:/auth/login/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'sentrysid': 'gAJ9cQFVBV9uZXh0WAEAAAAvcy4:1c3gQ9:vsel1uyK2FtH8CZ3hKqAJJgP848'},
META:{u'CSRF_COOKIE': u'fXBlb5AbYEFLyanmVLbNopYUR4SlFwRq',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, sdch',
 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8',
 'HTTP_CACHE_CONTROL': 'no-cache',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'sentrysid="gAJ9cQFVBV9uZXh0WAEAAAAvcy4:1c3gQ9:vsel1uyK2FtH8CZ3hKqAJJgP848"',
 'HTTP_HOST': '52.26.62.201:9000',
 'HTTP_PRAGMA': 'no-cache',
 'HTTP_REFERER': 'http://52.26.62.201:9000/auth/login/',
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36',
 'PATH_INFO': u'/auth/login/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '123.201.137.254',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/auth/login/',
 'SCRIPT_NAME': u'',
 'SERVER_NAME': 'cfc930779cc8',
 'SERVER_PORT': '9000',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'uwsgi.core': 0,
 'uwsgi.node': 'cfc930779cc8',
 'uwsgi.version': '2.0.14',
 'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x7f47b35b8780>,
 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
 'wsgi.input': <uwsgi._Input object at 0x7f47b39b6f18>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/error_500.py", line 22, in get_embed_config
    )[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
09:46:08 [ERROR] root: Unable to fetch ProjectKey for internal project
09:46:08 [ERROR] sentry.errors: Internal project (id=1) does not exist
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/templatetags/sentry_react.py", line 66, in _get_public_dsn
    )[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/../django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
09:46:08 [ERROR] root: Unable to fetch ProjectKey for internal project
09:46:08 [ERROR] sentry.errors: Internal project (id=1) does not exist
123.201.137.254 - - [07/Nov/2016:09:46:08 +0000] "GET /auth/login/ HTTP/1.1" 500 8637 "http://52.26.62.201:9000/auth/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:09 +0000] "GET /_static/1478511968/sentry/dist/sentry.css HTTP/1.1" 200 52259 "http://52.26.62.201:9000/auth/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:09 +0000] "GET /_static/1478511968/sentry/dist/vendor.js HTTP/1.1" 200 223893 "http://52.26.62.201:9000/auth/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:09 +0000] "GET /_static/1478511968/sentry/dist/app.js HTTP/1.1" 200 137474 "http://52.26.62.201:9000/auth/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:10 +0000] "GET /_static/1478511968/sentry/dist/sentry.js.map HTTP/1.1" 200 350 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:12 +0000] "GET /_static/1478511968/sentry/dist/sentry-simple.woff HTTP/1.1" 200 13743 "http://52.26.62.201:9000/_static/1478511968/sentry/dist/sentry.css" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:12 +0000] "GET /_static/1478511968/sentry/dist/lato-regular.woff HTTP/1.1" 200 32155 "http://52.26.62.201:9000/_static/1478511968/sentry/dist/sentry.css" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:12 +0000] "GET /_static/1478511968/sentry/dist/lato-bold.woff HTTP/1.1" 200 32747 "http://52.26.62.201:9000/_static/1478511968/sentry/dist/sentry.css" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:12 +0000] "GET /_static/1478511968/sentry/dist/sentry-pattern.png HTTP/1.1" 200 28417 "http://52.26.62.201:9000/_static/1478511968/sentry/dist/sentry.css" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:14 +0000] "GET /_static/1478511968/sentry/images/icons/apple-touch-icon.png HTTP/1.1" 200 6266 "http://52.26.62.201:9000/auth/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:15 +0000] "GET /_static/1478511968/sentry/images/favicon.ico HTTP/1.1" 200 6791 "http://52.26.62.201:9000/auth/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:12 +0000] "GET /_static/1478511968/sentry/dist/app.js.map HTTP/1.1" 200 656653 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"
123.201.137.254 - - [07/Nov/2016:09:46:12 +0000] "GET /_static/1478511968/sentry/dist/vendor.js.map HTTP/1.1" 200 1350709 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"

and when I access http://myurl:9000/auth/login/
Internal server error

 Oops! Something went wrong
It looks like you've hit an issue in our server API. Don't worry though! We use Sentry to monitor Sentry and it's likely we're already looking into this!
If you're daring, you may want to try the following:
Give it a few seconds and reload the page.
If all else fails, create an issue with more details.

you mentioned upgraded server ? what did you do?

@lukepolo

This comment has been minimized.

Copy link
Author

@lukepolo lukepolo commented Nov 7, 2016

Your memory size is to low, i was using Digtal ocean 512, you will need more for sure , how much im not sure , i went up to a 2GB instance.

@thamaraiselvam

This comment has been minimized.

Copy link

@thamaraiselvam thamaraiselvam commented Nov 8, 2016

Thanks @lukepolo upgraded server to 2GB then upgrade process went fine

@PabloReszczynski

This comment has been minimized.

Copy link

@PabloReszczynski PabloReszczynski commented Feb 20, 2018

Should there be a better error message when this happens? I'm having the same problem. Upgrade and migrations run fine but I get the error when I run the web.

@jamiecounsell

This comment has been minimized.

Copy link

@jamiecounsell jamiecounsell commented Feb 25, 2018

I had the same issue, but it was because the migrations never completed. Ends up they failed at CREATE EXTENSION IF NOT EXISTS citext; due to the permissions of the database user I was using. I created the extension manually and re-ran upgrade. It all worked after that.

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

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.