heroku

Viewing log files written to the filesystem on Heroku

只谈情不闲聊 提交于 2021-01-29 14:57:03
问题 I have a gem (rails-latex) that is not functioning correctly on my app deployed to Heroku but works fine on my local app. I succeeded in installing pdflatex on Heroku so that is not the issue. To debug this further, I would need to see the log file described in the Heroku logs 2014-03-23T04:32:21.431646+00:00 app[web.1]: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) 2014-03-23T04:32:21.431646+00:00 app[web.1]: \write18 enabled. 2014-03-23T04:32:21.450999+00:00 app[web.1]:

Requests works locally but not deployed on Heroku

纵然是瞬间 提交于 2021-01-29 14:30:14
问题 This code works locally, but when I deploy it to Heroku, I get ModuleNotFoundError: No module named 'requests'. (Note: urllib.parse works fine — news_link prints.) import urllib.parse as url_parse url = rurl news_link = url_parse.unquote(url).split("?u=")[1].split("?fbclid")[0] print("here comes the news_link") print(news_link) import requests final_link = requests.get(news_link) print("here comes the final_link.url") 回答1: It looks like you forgot to include requests in the requirements.txt

How can I roll my own auto-scaling on heroku?

天大地大妈咪最大 提交于 2021-01-29 13:50:30
问题 Heroku doesn't offer auto-scaling for anything under the "performance tier" dynos ($250/mo). Hirefire used to be a gem that you could configure to autoscale dynos, but they realized that their solution could make money so now it's a paid service. What options are there (including rolling my own) for smaller apps to have intelligent scaling of dynos at no extra cost? 回答1: The cheapest solution in term of money, but at the cost of time would be to use Heroku's Platform API. The formation

Rails (PG::GroupingError: ERROR: column must appear in the GROUP BY clause or be used in an aggregate function

本小妞迷上赌 提交于 2021-01-29 13:49:32
问题 In my local this query work perfect with sqlite3 def Event.most_like select("events.*, count(like_events.event_id) as likes_count") .joins(:like_events).group(:event_id).order("likes_count DESC").limit(4) end but i got some error when deploy heroku PG::GroupingError: ERROR: column "events.id" must appear in the GROUP BY clause or be used in an aggregate function Can someone help me fix this? 回答1: As the message, all fields in Select clause must appear in the GROUP BY or in aggregate function.

How to deploy node js app with react to heroku

我的未来我决定 提交于 2021-01-29 13:32:58
问题 I trying deploy my MERN app to heroku. After build success on heroku doesn't see a API routes: Steps : On localhost I run concurrently node server and client (create-react-app). Server on port 5000 and client on port 3000. After this I fetch from API routes /hotels Array with items and connect it to Redux store and display it. Properly behavior: Localhost : works fine Heroku : broken (didn't connect with API) This is my server.js file: const express = require('express'); const path = require(

Saving a json file on Heroku

╄→гoц情女王★ 提交于 2021-01-29 11:44:55
问题 I have a simple sinatra app on Heroku which fetches some json data and is then fetched again and rewritten every 10 minutes, what would be the easiest way to save the json data? Should I use S3 or mongodb or is there a simpler option? 回答1: I think writing into a database (mongodb or other) would be your best bet. It's simplest to set up on Heroku. 回答2: I think the easiest route is to save your json using Heroku's free 5mb memcached plugin (use the dalli gem), This link describes setting up a

Celery with Redis broker in Django: tasks successfully execute, but too many persistent Redis keys and connections remain

感情迁移 提交于 2021-01-29 11:28:07
问题 Our Python server (Django 1.11.17) uses Celery 4.2.1 with Redis as the broker (the pip redis package we're using is 3.0.1). The Django app is deployed to Heroku, and the Celery broker was set up using Heroku's Redis Cloud add-on. The Celery tasks we have should definitely have completed within a minute (median completion time is ~100 ms), but we're seeing that Redis keys and connections are persisting for much, much longer than that (up to 24 hours). Otherwise, tasks are being executed

Is there a way to prevent cycling from heroku?

你离开我真会死。 提交于 2021-01-29 11:10:57
问题 I want to host my discord bot 24/7, but my bot cycled by heroku every day so it had some downtime. How can I prevent this? 回答1: Heroku Dynos restart every 24hrs, this is done for all Dynos and you cannot avoid it. There is the option to preboot web Dynos (redirect traffic during the restart) but it comes only with the more expensive subscriptions. 来源: https://stackoverflow.com/questions/64858860/is-there-a-way-to-prevent-cycling-from-heroku

Does the free tier of Heroku apps support file upload?

耗尽温柔 提交于 2021-01-29 10:42:00
问题 I am testing out a MEAN stack application. I have a Node.js backend which handles file upload (via fs/multer ). However I'm receiving a 503 error when trying to hit it in production. Locally everything is working fine. I am using Heroku's free tier; is that tier locked to not allow file upload? The upload I'm trying currently (have tried several) is only 36kb ( .png ). Went through my logs and found the 503- 2018-10-26T20:39:24.352297+00:00 heroku[router]: at=error code=H13 desc="Connection

MySQL query errors when connecting from Celery task running on Heroku

梦想与她 提交于 2021-01-29 10:31:20
问题 I'm seeing wrong query results when executing queries against an external MySQL database, but only when connecting from Celery tasks running on Heroku. The same tasks, when run on my own machine do not show these errors, and the errors only appear about half of the time (although when they fail, all tasks are wrong). The tasks are managed by Celery via Redis, and the MySQL database does not itself run on Heroku. Both my local machine and Heroku connect to the same MySQL database. I connect to