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

Add workers to PostHog #455

Closed
1 of 4 tasks
timgl opened this issue Apr 6, 2020 · 12 comments · Fixed by #473
Closed
1 of 4 tasks

Add workers to PostHog #455

timgl opened this issue Apr 6, 2020 · 12 comments · Fixed by #473
Assignees

Comments

@timgl
Copy link
Collaborator

timgl commented Apr 6, 2020

We've had a couple of instances now where we'd like to use workers:

Solution

I think there's two options:

  1. Traditional worker queue with Celery and Redis
  2. Use something like django-postgres-queue

The upside of 1 is it's more proven and is basically the standard for how everyone does queues. The downside is it means we have to get everyone to deploy a Redis database in addition to a Postgres database.

UPDATE
After discussion with @mariusandra, decided that we're going to go for Redis. it's not that hard to add it to the Helm charts for example, and Redis will allow us to scale much further than the Postgres solution would.

Open questions

  • Solution 1 vs 2
  • What does migration look like for the various deployment options (Heroku, Docker, K8s, - GitLab?).
  • If an action is required, could we work out that someone hasn't started a worker and just run those tasks sequentially?
  • Does adding workers mean we can have cron jobs too? (Like sending some usage stats, clearing out old data etc)
@mariusandra
Copy link
Collaborator

To comment on Tim's update and 1vs2: django-postgres-queue also has 51 stars and while I'm sure it does the job, it doesn't look like a very active project. Compared to Rails's delayed_job for example (4.5k stars). It's better to use proven and widely used technology.

No comment on the other open questions at the moment.

@mariusandra
Copy link
Collaborator

Hi, trying to answer the rest of the questions:

Migration for various options:

  • Heroku will be fine. I updated app.json to include a heroku redis instance and to run the worker. Seems to work well so far.
  • Docker. I added redis to docker-compose.yml and built the app. Everything works well. The only big change I had to do was to split ./bin/docker into ./bin/docker-migrate, ./bin/docker-server and ./bin/docker-worker and then run all of them inside ./bin/docker. The worker now boots up when I run a local docker image. We will have some potential problems for people migrating to this version though, as now the REDIS_URL environment variable is required. I'm not sure if that requires a major version bump. The docs.posthog.com part about installing via docker needs to be updated though.
  • K8s/Helm. I haven't configured it yet, but helm charts are tagged to a specific docker image version. We should always publish new charts when a new docker image is released. When this is done, I'll make a new chart and add redis and the celery as things it'll pull and start automatically.
  • Gitlab still hasn't deployed our chart, but once they do, then it's a matter of just upgrading the version in the chart and updating the documentation to offer the option to hook the app to a self-hosted redis instance. Everything else should work well.

Cron jobs
Definitely possible

Running without workers as a fallback option
I'm not sure, but somehow I'd advise against this. Better to make sure that the worker is always running. Otherwise we'll get issues like "posthog is suddenly really slow" and other weird things. The folks at celery also recommend aganst this. I think it's better to have a perodic task that saves a heartbeat with the current timestamp to postgres or redis, which we can then ask for in the frontend. When that's off by more than a set amount we can display a "your background worker seems to be down" message.

@timgl timgl closed this as completed in #473 Apr 7, 2020
@timgl
Copy link
Collaborator Author

timgl commented Apr 7, 2020

@mariusandra I tried deploying this update to Heroku and I did have to manually turn the worker on, though that might have been because I was using professional dyno's.

I also think I had to set the $REDIS_URL specifically in the Procfile:
celery -A posthog worker -b $REDIS_URL.

I think that means people could upgrade Heroku and not know they need to turn on their worker, losing data in the process. I definitely think it's worth doing this warning message in the frontend before we move any actual work to the workers.

@timgl timgl reopened this Apr 7, 2020
@mariusandra
Copy link
Collaborator

What about this idea: we make redis and the worker optional for at least another week. It'll be there, but nothing will happen if you start the app without it. I'll also implement a worker heartbeat system (ping every minute, stored in redis), which we'll use to say if the worker is actually running or not. Somewhere in the header of the app we'll show a large red /!\ if we detect that the worker is not running with information on how to fix it.

This should provide at least some feedback to the users in a non-destructive way.

@timgl
Copy link
Collaborator Author

timgl commented Apr 7, 2020

I like that, we can release 1.0.11 tomorrow (ideally with that error message) so if people upgrade they'll know they need to turn on workers but they won't have lost data. Then when we release 1.1.0 next week we can have moved stuff over to workers.

Sounds good to me. Created #489 for you

@mariusandra
Copy link
Collaborator

Great! I'll start with it tomorrow morning. I think I can get some warning up by noon latest.

Regarding losing data, if redis is up and just the worker down, as would be the case with heroku deploys where the worker won't get added, but redis will, then there will be no data loss. The events will still get queued in redis, just nothing will process them. A big red warning will hopefully get ops people to fix the queue.

If you start a posthog instance without redis attahed to it, the code that creates jobs will just throw an error and we will probably experience data loss indeed. That's with 1.1.0, not for tomorrow's release.

@timgl timgl closed this as completed Apr 8, 2020
@Immortalin
Copy link

I think the docs can be better clarified that "turn redis worker on" means to activate the heroku redis addon.

@timgl
Copy link
Collaborator Author

timgl commented Apr 8, 2020

@Immortalin Hm the Heroku redis addon should have been automatically provisioned. Did that not happen for you?

The docs talk about provisioning a worker dyno, but I see I have worded that poorly

@Immortalin
Copy link

Nope, it did not. Here's the stack trace:

~/D/P/A/posthog (master)> git push -f heroku master
Counting objects: 5050, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1460/1460), done.
Writing objects: 100% (5050/5050), 2.85 MiB | 1.57 MiB/s, done.
Total 5050 (delta 3544), reused 5024 (delta 3537)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:        engines.yarn (package.json):  unspecified (use default)
remote:        
remote:        Resolving node version 12.x...
remote:        Downloading and installing node 12.16.1...
remote:        Using default npm version: 6.13.4
remote:        Resolving yarn version 1.x...
remote:        Downloading and installing yarn (1.22.4)...
remote:        Installed yarn 1.22.4
remote:        
remote: -----> Restoring cache
remote:        - node_modules
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.22.4
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        info fsevents@2.1.2: The platform "linux" is incompatible with this module.
remote:        info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
remote:        info fsevents@1.2.11: The platform "linux" is incompatible with this module.
remote:        info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
remote:        [3/4] Linking dependencies...
remote:        warning " > bootstrap@4.4.1" has unmet peer dependency "jquery@1.9.1 - 3".
remote:        warning " > bootstrap@4.4.1" has unmet peer dependency "popper.js@^1.16.0".
remote:        warning " > styled-components@5.0.1" has unmet peer dependency "react-is@>= 16.8.0".
remote:        [4/4] Building fresh packages...
remote:        Done in 55.17s.
remote:        
remote: -----> Build
remote:        Running build (yarn)
remote:        yarn run v1.22.4
remote:        $ NODE_ENV=production webpack --config webpack.config.js && cp -a frontend/public/* frontend/dist/
remote:        Hash: fcbf26c91f8d8c89169c
remote:        Version: webpack 4.42.0
remote:        Time: 48651ms
remote:        Built at: 04/08/2020 5:43:52 PM
remote:                                              Asset      Size  Chunks                    Chunk Names
remote:                                               2.js   260 KiB       2  [emitted]  [big]  
remote:                                               3.js  9.47 KiB       3  [emitted]         
remote:                                          editor.js   402 KiB       0  [emitted]  [big]  editor
remote:         fonts/0154aa409181c8a53447bc719b3d1cbf.eot  61.9 KiB          [emitted]         
remote:        fonts/1312d7e3cd68fcee451b30438fca910d.woff  31.7 KiB          [emitted]         
remote:         fonts/863d2ad0717854222efdb41771207794.ttf  61.7 KiB          [emitted]         
remote:        images/1bbef030ce8fe8188eb5011a2f577ba1.svg   490 KiB          [emitted]  [big]  
remote:                                           main.css   171 KiB       1  [emitted]         main
remote:                                            main.js  1.06 MiB       1  [emitted]  [big]  main
remote:        Entrypoint main [big] = main.css main.js
remote:        Entrypoint editor [big] = editor.js
remote:          [9] ./frontend/src/lib/utils.js 8.11 KiB {0} {1} [built]
remote:         [11] ./frontend/src/lib/api.js 3.04 KiB {0} {1} [built]
remote:         [32] ./frontend/src/scenes/userLogic.js 4.94 KiB {0} {1} [built]
remote:         [35] ./node_modules/react-toastify/esm/react-toastify.js + 9 modules 63.5 KiB {0} {1} [built]
remote:              |    10 modules
remote:         [49] (webpack)/buildin/global.js 472 bytes {0} {1} [built]
remote:         [68] ./frontend/src/lib/components/AppEditorLink/AppEditorLink.js + 3 modules 8.64 KiB {0} {1} [built]
remote:              |    4 modules
remote:         [74] ./node_modules/react-redux/es/index.js + 24 modules 50.3 KiB {0} {1} [built]
remote:              |    25 modules
remote:         [79] ./frontend/src/scenes/actions/ActionEdit.js + 2 modules 25.7 KiB {0} {1} [built]
remote:              | ./frontend/src/scenes/actions/ActionEdit.js 8.31 KiB [built]
remote:              | ./frontend/src/scenes/actions/ActionStep.js 14.8 KiB [built]
remote:              | ./frontend/src/scenes/actions/EventName.js 2.49 KiB [built]
remote:         [97] (webpack)/buildin/harmony-module.js 573 bytes {0} {1} [built]
remote:        [268] ./frontend/src/style.scss 39 bytes {1} [built]
remote:        [333] ./frontend/src/editor/index.js 7.4 KiB {0} [built]
remote:        [350] ./frontend/src/index.js + 79 modules 313 KiB {1} [built]
remote:              | ./frontend/src/index.js 1.23 KiB [built]
remote:              | ./frontend/src/scenes/App.js 4.26 KiB [built]
remote:              | ./frontend/src/scenes/events/Events.js 155 bytes [built]
remote:              | ./frontend/src/scenes/users/Person.js 2 KiB [built]
remote:              | ./frontend/src/layout/Sidebar.js 4.97 KiB [built]
remote:              | ./frontend/src/scenes/users/People.js 3.13 KiB [built]
remote:              | ./frontend/src/scenes/actions/Actions.js 872 bytes [built]
remote:              | ./frontend/src/scenes/actions/Action.js 2.01 KiB [built]
remote:              | ./frontend/src/layout/TopContent.js 577 bytes [built]
remote:              | ./frontend/src/scenes/funnels/EditFunnel.js 8.29 KiB [built]
remote:              | ./frontend/src/scenes/funnels/Funnel.js 5.3 KiB [built]
remote:              | ./frontend/src/scenes/funnels/Funnels.js 3.4 KiB [built]
remote:              | ./frontend/src/scenes/actions/ActionEvents.js 922 bytes [built]
remote:              | ./frontend/src/scenes/setup/Setup.js 2.95 KiB [built]
remote:              | ./frontend/src/scenes/trends/Trends.js 5.03 KiB [built]
remote:              |     + 65 hidden modules
remote:        [362] ./node_modules/d3-shape/src/index.js + 46 modules 52.4 KiB {2} [built]
remote:              |    47 modules
remote:        [364] ./node_modules/d3/index.js + 466 modules 483 KiB {2} [built]
remote:              |    467 modules
remote:        [365] ./node_modules/d3-sankey/src/index.js + 7 modules 12.7 KiB {3} [built]
remote:              |    8 modules
remote:            + 398 hidden modules
remote:        
remote:        WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
remote:        This can impact web performance.
remote:        Assets: 
remote:          images/1bbef030ce8fe8188eb5011a2f577ba1.svg (490 KiB)
remote:          editor.js (402 KiB)
remote:          main.js (1.06 MiB)
remote:          2.js (260 KiB)
remote:        
remote:        WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
remote:        Entrypoints:
remote:          main (1.23 MiB)
remote:              main.css
remote:              main.js
remote:          editor (402 KiB)
remote:              editor.js
remote:        
remote:        Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!node_modules/postcss-loader/src/index.js!node_modules/sass-loader/dist/cjs.js??ref--5-3!frontend/src/style.scss:
remote:            Entrypoint mini-css-extract-plugin = *
remote:            [0] ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js??ref--5-3!./frontend/src/style.scss 135 KiB {0} [built]
remote:            [3] ./frontend/src/style/font/Flaticon.eot 86 bytes {0} [built]
remote:            [4] ./frontend/src/style/font/Flaticon.woff 87 bytes {0} [built]
remote:            [5] ./frontend/src/style/font/Flaticon.ttf 86 bytes {0} [built]
remote:            [6] ./frontend/src/style/font/Flaticon.svg 87 bytes {0} [built]
remote:                + 2 hidden modules
remote:        Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!node_modules/postcss-loader/src/index.js!node_modules/sass-loader/dist/cjs.js??ref--5-3!node_modules/react-datepicker/dist/react-datepicker.css:
remote:            Entrypoint mini-css-extract-plugin = *
remote:               2 modules
remote:        Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!node_modules/postcss-loader/src/index.js!node_modules/sass-loader/dist/cjs.js??ref--5-3!node_modules/react-toastify/dist/ReactToastify.css:
remote:            Entrypoint mini-css-extract-plugin = *
remote:               2 modules
remote:        Done in 50.01s.
remote:        
remote: -----> Caching build
remote:        - node_modules
remote:        
remote: -----> Pruning devDependencies
remote:        yarn install v1.22.4
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        info fsevents@2.1.2: The platform "linux" is incompatible with this module.
remote:        info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
remote:        info fsevents@1.2.11: The platform "linux" is incompatible with this module.
remote:        info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
remote:        [3/4] Linking dependencies...
remote:        warning " > bootstrap@4.4.1" has unmet peer dependency "jquery@1.9.1 - 3".
remote:        warning " > bootstrap@4.4.1" has unmet peer dependency "popper.js@^1.16.0".
remote:        warning " > styled-components@5.0.1" has unmet peer dependency "react-is@>= 16.8.0".
remote:        [4/4] Building fresh packages...
remote:        warning Ignored scripts due to flag.
remote:        Done in 8.38s.
remote:        
remote: -----> Build succeeded!
remote:  !     Unmet dependencies don't fail yarn install but may cause runtime issues
remote:        https://github.com/npm/npm/issues/7494
remote: 
remote: -----> Python app detected
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote:        Collecting amqp==2.5.2 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/fc/a0/6aa2a7923d4e82dda23db27711d565f0c4abf1570859f168e3d0975f1eb6/amqp-2.5.2-py2.py3-none-any.whl (49kB)
remote:        Collecting billiard==3.6.3.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 6))
remote:          Downloading https://files.pythonhosted.org/packages/e8/5e/7591866ff45b370354bd20291cb6f87ddb2eef1f1c88c890a38412037e11/billiard-3.6.3.0-py3-none-any.whl (89kB)
remote:        Collecting celery==4.4.2 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 7))
remote:          Downloading https://files.pythonhosted.org/packages/7e/54/4d87a8f589259456efb09f574d538fcf3fd7339a3daaae8e02320c1780f1/celery-4.4.2-py2.py3-none-any.whl (422kB)
remote:        Collecting celery-redbeat==0.13.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 8))
remote:          Downloading https://files.pythonhosted.org/packages/43/dc/b2dff764e1a9f956e25880635cf1042602d430184b4727c3773764d66d80/celery-redbeat-0.13.0.tar.gz
remote:        Collecting cffi==1.14.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 10))
remote:          Downloading https://files.pythonhosted.org/packages/f1/c7/72abda280893609e1ddfff90f8064568bd8bcb2c1770a9d5bb5edb2d1fea/cffi-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (399kB)
remote:        Collecting cryptography==2.9 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 14))
remote:          Downloading https://files.pythonhosted.org/packages/dc/5e/e1e6991a841a9e88eb848634026199fa92665ae792ee6362a0cfa0ece3dc/cryptography-2.9-cp35-abi3-manylinux1_x86_64.whl (2.7MB)
remote:        Collecting defusedxml==0.6.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 16))
remote:          Downloading https://files.pythonhosted.org/packages/06/74/9b387472866358ebc08732de3da6dc48e44b0aacd2ddaa5cb85ab7e986a2/defusedxml-0.6.0-py2.py3-none-any.whl
remote:        Collecting django-extensions==2.2.8 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 20))
remote:          Downloading https://files.pythonhosted.org/packages/c9/9f/c780e0360fb10a36b519d015096d93311088fcec4874a9238bb8996013dc/django_extensions-2.2.8-py2.py3-none-any.whl (224kB)
remote:        Collecting django-slack==5.14.3 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 22))
remote:          Downloading https://files.pythonhosted.org/packages/dd/15/a21b20fa332ea140c0885d14dcc9bd5e4bf70cf4acab3e37da1277c897df/django-slack-5.14.3.tar.gz
remote:        Collecting importlib-metadata==1.6.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 30))
remote:          Downloading https://files.pythonhosted.org/packages/ad/e4/891bfcaf868ccabc619942f27940c77a8a4b45fd8367098955bb7e152fb1/importlib_metadata-1.6.0-py2.py3-none-any.whl
remote:        Collecting kombu==4.6.8 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 38))
remote:          Downloading https://files.pythonhosted.org/packages/34/7e/44445f7d9031e82b4a1160141de35ca810f44041bf5065b45c68ab0ec9e8/kombu-4.6.8-py2.py3-none-any.whl (183kB)
remote:        Collecting oauthlib==3.1.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 44))
remote:          Downloading https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147kB)
remote:        Collecting packaging==20.1 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 45))
remote:          Downloading https://files.pythonhosted.org/packages/98/42/87c585dd3b113c775e65fd6b8d9d0a43abe1819c471d7af702d4e01e9b20/packaging-20.1-py2.py3-none-any.whl
remote:        Collecting posthoganalytics==1.0.10 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 50))
remote:          Downloading https://files.pythonhosted.org/packages/06/15/135aa337e3a9b30366917799cd17b081249d24189805144aaa9b48c467b0/posthoganalytics-1.0.10-py2.py3-none-any.whl
remote:        Collecting pycparser==2.20 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 55))
remote:          Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
remote:        Collecting PyJWT==1.7.1 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 57))
remote:          Downloading https://files.pythonhosted.org/packages/87/8b/6a9f14b5f781697e51259d81657e6048fd31a113229cf346880bb7545565/PyJWT-1.7.1-py2.py3-none-any.whl
remote:        Collecting python3-openid==3.1.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 60))
remote:          Downloading https://files.pythonhosted.org/packages/bd/de/52c5699f52dcee3037db587196dcaf63ffedf5fbeba3183afe9b21a3a89f/python3_openid-3.1.0-py3-none-any.whl (130kB)
remote:        Collecting redis==3.4.1 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 62))
remote:          Downloading https://files.pythonhosted.org/packages/f0/05/1fc7feedc19c123e7a95cfc9e7892eb6cdd2e5df4e9e8af6384349c1cc3d/redis-3.4.1-py2.py3-none-any.whl (71kB)
remote:        Collecting requests-oauthlib==1.3.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 64))
remote:          Downloading https://files.pythonhosted.org/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl
remote:        Collecting social-auth-app-django==3.1.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 69))
remote:          Downloading https://files.pythonhosted.org/packages/9f/13/3be586914f69fe9d11beee01b938d329589045dfe90076529c82dae97578/social_auth_app_django-3.1.0-py3-none-any.whl
remote:        Collecting social-auth-core==3.3.3 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 70))
remote:          Downloading https://files.pythonhosted.org/packages/1a/b8/d08eb9a0955c3a93ef2e49f56214fcef59ce492c41f38cd14349ed94ca8c/social_auth_core-3.3.3-py3-none-any.whl (326kB)
remote:        Collecting tenacity==6.1.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 72))
remote:          Downloading https://files.pythonhosted.org/packages/9a/30/4d1205370f249f6e3ff0d29f8eb3aebfb7f88bf925364a222c6abcbc383e/tenacity-6.1.0-py2.py3-none-any.whl
remote:        Collecting vine==1.3.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 79))
remote:          Downloading https://files.pythonhosted.org/packages/7f/60/82c03047396126c8331ceb64da1dc52d4f1317209f32e8fe286d0c07365a/vine-1.3.0-py2.py3-none-any.whl
remote:        Collecting Werkzeug==1.0.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 81))
remote:          Downloading https://files.pythonhosted.org/packages/ba/a5/d6f8a6e71f15364d35678a4ec8a0186f980b3bd2545f40ad51dd26a87fb1/Werkzeug-1.0.0-py2.py3-none-any.whl (298kB)
remote:        Collecting zipp==3.1.0 (from -r /tmp/build_b3beeddf8fa63dfaec14908064687270/requirements.txt (line 83))
remote:          Downloading https://files.pythonhosted.org/packages/b2/34/bfcb43cc0ba81f527bc4f40ef41ba2ff4080e047acb0586b56b3d017ace4/zipp-3.1.0-py3-none-any.whl
remote:        Installing collected packages: vine, amqp, billiard, zipp, importlib-metadata, kombu, celery, redis, tenacity, celery-redbeat, pycparser, cffi, cryptography, defusedxml, django-extensions, django-slack, oauthlib, packaging, posthoganalytics, PyJWT, python3-openid, requests-oauthlib, social-auth-core, social-auth-app-django, Werkzeug
remote:          Running setup.py install for celery-redbeat: started
remote:            Running setup.py install for celery-redbeat: finished with status 'done'
remote:          Running setup.py install for django-slack: started
remote:            Running setup.py install for django-slack: finished with status 'done'
remote:          Found existing installation: packaging 20.3
remote:            Uninstalling packaging-20.3:
remote:              Successfully uninstalled packaging-20.3
remote:          Found existing installation: posthoganalytics 1.0.9
remote:            Uninstalling posthoganalytics-1.0.9:
remote:              Successfully uninstalled posthoganalytics-1.0.9
remote:        Successfully installed PyJWT-1.7.1 Werkzeug-1.0.0 amqp-2.5.2 billiard-3.6.3.0 celery-4.4.2 celery-redbeat-0.13.0 cffi-1.14.0 cryptography-2.9 defusedxml-0.6.0 django-extensions-2.2.8 django-slack-5.14.3 importlib-metadata-1.6.0 kombu-4.6.8 oauthlib-3.1.0 packaging-20.1 posthoganalytics-1.0.10 pycparser-2.20 python3-openid-3.1.0 redis-3.4.1 requests-oauthlib-1.3.0 social-auth-app-django-3.1.0 social-auth-core-3.3.3 tenacity-6.1.0 vine-1.3.0 zipp-3.1.0
remote: 
remote: -----> $ python manage.py collectstatic --noinput
remote:        ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
remote:        ️⚠️ 🚨🚨🚨 PostHog warning! 🚨🚨🚨
remote:        ⚠️
remote:        ️⚠️ The environment variable REDIS_URL is not configured!
remote:        ⚠️ Redis will be mandatory in the next versions of PostHog (1.1.0+).
remote:        ⚠️ Please configure it now to avoid future surprises!
remote:        ⚠️
remote:        ⚠️ See here for more information!
remote:        ⚠️ --> https://docs.posthog.com/#/upgrading-posthog?id=upgrading-from-before-1011
remote:        ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
remote:        Traceback (most recent call last):
remote:          File "manage.py", line 21, in <module>
remote:            main()
remote:          File "manage.py", line 17, in main
remote:            execute_from_command_line(sys.argv)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
remote:            utility.execute()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 345, in execute
remote:            settings.INSTALLED_APPS
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
remote:            self._setup(name)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
remote:            self._wrapped = Settings(settings_module)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
remote:            mod = importlib.import_module(self.SETTINGS_MODULE)
remote:          File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
remote:            return _bootstrap._gcd_import(name[level:], package, level)
remote:          File "<frozen importlib._bootstrap>", line 994, in _gcd_import
remote:          File "<frozen importlib._bootstrap>", line 971, in _find_and_load
remote:          File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
remote:          File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
remote:          File "<frozen importlib._bootstrap>", line 994, in _gcd_import
remote:          File "<frozen importlib._bootstrap>", line 971, in _find_and_load
remote:          File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
remote:          File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
remote:          File "<frozen importlib._bootstrap_external>", line 678, in exec_module
remote:          File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
remote:          File "/tmp/build_b3beeddf8fa63dfaec14908064687270/posthog/__init__.py", line 3, in <module>
remote:            from posthog.celery import app as celery_app
remote:          File "/tmp/build_b3beeddf8fa63dfaec14908064687270/posthog/celery.py", line 23, in <module>
remote:            redis_instance = redis.from_url(settings.REDIS_URL, db=0)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/redis/utils.py", line 19, in from_url
remote:            return Redis.from_url(url, db, **kwargs)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/redis/client.py", line 673, in from_url
remote:            connection_pool = ConnectionPool.from_url(url, db=db, **kwargs)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/redis/connection.py", line 1046, in from_url
remote:            'schemes (%s)' % valid_schemes)
remote:        ValueError: Redis URL must specify one of the followingschemes (redis://, rediss://, unix://)
remote: 
remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote: 
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:
remote: 
remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1
remote: 
remote:        https://devcenter.heroku.com/articles/django-assets
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to narrationbox-posthog-analytics.
remote: 
To https://git.heroku.com/narrationbox-posthog-analytics.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/narrationbox-posthog-analytics.git'

@Immortalin
Copy link

Immortalin commented Apr 8, 2020

It works after I manually added the addon through the Heroku web ui and then triggered another deployment.

@timgl
Copy link
Collaborator Author

timgl commented Apr 8, 2020

Thanks for that, I think I know what's going on here. In terms of the worker not being activated, that's what's referred to in the docs. You might have to manually provision the worker Dyno.

@timgl
Copy link
Collaborator Author

timgl commented Apr 8, 2020

I've merged #508 which should prevent this for people in the future!

@timgl timgl reopened this Apr 9, 2020
@timgl timgl closed this as completed Apr 9, 2020
yakkomajuri pushed a commit that referenced this issue Oct 1, 2021
* Build healthcheck into index.js

* Add "Alternative modes" to README

* Fix uncaught reject in Sentry flush
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

Successfully merging a pull request may close this issue.

3 participants