MongoDB Record To Array Takes Forever - ruby-on-rails-3

I'm getting information from the database (MongoDB) and then converting it to an array like that:
#bs = coll.find("headers.from" => { "$regex" => email, "$options" => 'i' }, "date" => {"$gte" => initial_date, "$lte" => Time.now.utc})
puts "a seguir ao fetch"
puts #bs
#bs = #bs.to_a
This works very well but sometimes, it just enters in an infinite cycle (I believe) because It crashes my heroku app.
The response (the first line is the print of #bs):
2011-05-14T17:05:46+00:00 app[web.1]: DBResponse(flags=, cursor_id=, start=)
2011-05-14T17:06:16+00:00 heroku[router]: Error H12 (Request timeout) -> GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0
2011-05-14T17:06:47+00:00 heroku[router]: Error H12 (Request timeout) -> GET yapi.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=0ms bytes=0
2011-05-14T17:07:10+00:00 heroku[router]: Error H12 (Request timeout) -> GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0
2011-05-14T17:07:17+00:00 heroku[router]: Error H12 (Request timeout) -> GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0
2011-05-14T17:07:51+00:00 heroku[router]: Error H12 (Request timeout) -> GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0
I'd like to know why because I really can't find out why with all the debug information. IT just holds on the ".to_a" forever and the server is blocked.
Please help.
Thanks

From what I see, there is no reason for RoR to terminate this loop.
If you can, try initializing it as a Kernel#Array. Try this:
Array([1,2,3]) #=> [1, 2, 3]
Array(123) #=> [123]
Instead of:
arg = arg.to_a

Related

Laravel 8.4 project on Heroku error 403 in Apache after Procfile

I am deploying my first Laravel project using this guide: https://appdividend.com/2018/04/17/how-to-deploy-laravel-project-on-heroku/
I have made it up until step 9, in other words: I created a Procfile without file extension with web: vendor/bin/heroku-php-apache2 public/, generated and set the encryption key and successfully deployed the project.
However, when I visit the site, every page throws a 500 HTTP error displaying my custom error pages. This most definitely does not happen locally.
(I made one static page direct towards my custom 503 error page instead, so that GET request is normal.)
When I check the logs using PowerShell with heroku logs --tail I receive the following output:
2021-06-17T11:54:55.644540+00:00 app[api]: Release v1 created by user [REDACTED]
2021-06-17T11:54:55.644540+00:00 app[api]: Initial release by user [REDACTED]
2021-06-17T11:54:55.799446+00:00 app[api]: Release v2 created by user [REDACTED]
2021-06-17T11:54:55.799446+00:00 app[api]: Enable Logplex by user [REDACTED]
2021-06-17T11:57:42.028071+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=[REDACTED].herokuapp.com request_id=b9bfe3e2-82de-47af-bae4-1d6cbc4a206e fwd="my public IP" dyno= connect= service= status=502 bytes= protocol=https
2021-06-17T11:57:42.568855+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=[REDACTED].herokuapp.com request_id=6e51df46-02e7-4d6d-b515-3fa1c4834613 fwd="my public IP" dyno= connect= service= status=502 bytes= protocol=https
2021-06-17T11:58:03.455474+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=[REDACTED].herokuapp.com request_id=b61ff6e6-b904-486c-9624-a4b7d7804ae1 fwd="my public IP" dyno= connect= service= status=502 bytes= protocol=https
2021-06-17T12:06:23.000000+00:00 app[api]: Build started by user [REDACTED]
2021-06-17T12:06:36.341144+00:00 app[api]: Deploy 1e8d4442 by user [REDACTED]
2021-06-17T12:06:36.341144+00:00 app[api]: Release v3 created by user [REDACTED]
2021-06-17T12:06:36.351809+00:00 app[api]: Scaled to web#1:Free by user [REDACTED]
2021-06-17T12:06:37.000000+00:00 app[api]: Build succeeded
2021-06-17T12:06:38.816708+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2021-06-17T12:06:42.411923+00:00 app[web.1]: Detected 536870912 Bytes of RAM
2021-06-17T12:06:42.443766+00:00 app[web.1]: PHP memory_limit is 128M Bytes
2021-06-17T12:06:42.456606+00:00 app[web.1]: Starting php-fpm with 4 workers...
2021-06-17T12:06:42.569696+00:00 app[web.1]: Starting httpd...
2021-06-17T12:06:42.707664+00:00 heroku[web.1]: State changed from starting to up
2021-06-17T12:06:52.248862+00:00 heroku[router]: at=info method=GET path="/" host=[REDACTED].herokuapp.com request_id=717e7ca1-d1da-4138-be09-5907e1700504 fwd="my public IP" dyno=web.1 connect=0ms service=1ms status=403 bytes=363 protocol=https
2021-06-17T12:06:52.248875+00:00 app[web.1]: [Thu Jun 17 12:06:52.248017 2021] [autoindex:error] [pid 154:tid 140377919043328] [client 10.41.181.68:21921] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
2021-06-17T12:06:52.249127+00:00 app[web.1]: 10.41.181.68 - - [17/Jun/2021:12:06:52 +0000] "GET / HTTP/1.1" 403 199 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:12:36.039961+00:00 app[web.1]: [Thu Jun 17 12:12:36.038943 2021] [autoindex:error] [pid 153:tid 140377919043328] [client 10.11.176.31:24186] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
2021-06-17T12:12:36.040254+00:00 app[web.1]: 10.11.176.31 - - [17/Jun/2021:12:12:36 +0000] "GET / HTTP/1.1" 403 199 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:12:36.040292+00:00 heroku[router]: at=info method=GET path="/" host=[REDACTED].herokuapp.com request_id=588a07f2-6a82-4b19-be26-d99e86508e58 fwd="my public IP" dyno=web.1 connect=1ms service=2ms status=403 bytes=363 protocol=https
2021-06-17T12:25:42.485188+00:00 app[web.1]: [Thu Jun 17 12:25:42.484171 2021] [autoindex:error] [pid 155:tid 140377851950848] [client 10.41.171.6:11185] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
2021-06-17T12:25:42.485538+00:00 app[web.1]: 10.41.171.6 - - [17/Jun/2021:12:25:42 +0000] "GET / HTTP/1.1" 403 199 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:25:42.485879+00:00 heroku[router]: at=info method=GET path="/" host=[REDACTED].herokuapp.com request_id=e5fc29bf-1833-4b1c-87f0-47def5e79f58 fwd="my public IP" dyno=web.1 connect=4ms service=5ms status=403 bytes=363 protocol=https
2021-06-17T12:25:49.358661+00:00 app[web.1]: [Thu Jun 17 12:25:49.357969 2021] [autoindex:error] [pid 153:tid 140377784792832] [client 10.11.234.144:20872] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
2021-06-17T12:25:49.358970+00:00 app[web.1]: 10.11.234.144 - - [17/Jun/2021:12:25:49 +0000] "GET / HTTP/1.1" 403 199 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:25:49.359616+00:00 heroku[router]: at=info method=GET path="/" host=[REDACTED].herokuapp.com request_id=869f8dbd-262f-4462-b7bf-73294987cb14 fwd="my public IP" dyno=web.1 connect=0ms service=1ms status=403 bytes=363 protocol=https
2021-06-17T12:25:52.182757+00:00 app[web.1]: 10.11.234.144 - - [17/Jun/2021:12:25:52 +0000] "GET /favicon.ico HTTP/1.1" 404 196 "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:25:52.183507+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=[REDACTED].herokuapp.com request_id=aad7f101-8530-4270-8421-eb95038ad7f8 fwd="my public IP" dyno=web.1 connect=0ms service=1ms status=404 bytes=360 protocol=https
2021-06-17T12:33:54.000000+00:00 app[api]: Build started by user [REDACTED]
2021-06-17T12:34:07.641518+00:00 app[api]: Release v4 created by user [REDACTED]
2021-06-17T12:34:07.641518+00:00 app[api]: Deploy 30d06f26 by user [REDACTED]
2021-06-17T12:34:07.909412+00:00 heroku[web.1]: Restarting
2021-06-17T12:34:07.929249+00:00 heroku[web.1]: State changed from up to starting
2021-06-17T12:34:08.000000+00:00 app[api]: Build succeeded
2021-06-17T12:34:08.898217+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-06-17T12:34:08.962065+00:00 app[web.1]: SIGTERM received, attempting graceful shutdown...
2021-06-17T12:34:08.962075+00:00 app[web.1]: Stopping php-fpm...
2021-06-17T12:34:08.963414+00:00 app[web.1]: Stopping httpd...
2021-06-17T12:34:08.966608+00:00 app[web.1]: Shutdown complete.
2021-06-17T12:34:09.018975+00:00 heroku[web.1]: Process exited with status 143
2021-06-17T12:34:12.074660+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2 public/`
2021-06-17T12:34:17.481627+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'
2021-06-17T12:34:17.582367+00:00 app[web.1]: Detected 536870912 Bytes of RAM
2021-06-17T12:34:17.619538+00:00 app[web.1]: PHP memory_limit is 128M Bytes
2021-06-17T12:34:17.639142+00:00 app[web.1]: Starting php-fpm with 4 workers...
2021-06-17T12:34:17.741847+00:00 app[web.1]: Starting httpd...
2021-06-17T12:34:18.057406+00:00 heroku[web.1]: State changed from starting to up
2021-06-17T12:34:40.311200+00:00 heroku[router]: at=info method=GET path="/" host=[REDACTED].herokuapp.com request_id=c694d2d3-d81d-4956-a56a-5e437fdd25af fwd="my public IP" dyno=web.1 connect=1ms service=244ms status=500 bytes=2276 protocol=https
2021-06-17T12:34:40.316794+00:00 app[web.1]: 10.13.167.33 - - [17/Jun/2021:12:34:40 +0000] "GET / HTTP/1.1" 500 2052 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:34:40.584831+00:00 heroku[router]: at=info method=GET path="/js/javascript.js" host=[REDACTED].herokuapp.com request_id=c4e5457f-54d6-47ab-a49b-25d0f6847a33 fwd="my public IP" dyno=web.1 connect=1ms service=2ms status=200 bytes=392 protocol=https
2021-06-17T12:34:40.590691+00:00 app[web.1]: 10.13.167.33 - - [17/Jun/2021:12:34:40 +0000] "GET /js/javascript.js HTTP/1.1" 200 148 "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:34:40.702186+00:00 heroku[router]: at=info method=GET path="/css/style.css" host=[REDACTED].herokuapp.com request_id=9966283b-2868-4eb0-99d4-ff23fcf3bf86 fwd="my public IP" dyno=web.1 connect=1ms service=2ms status=200 bytes=5614 protocol=https
2021-06-17T12:34:40.707977+00:00 app[web.1]: 10.13.167.33 - - [17/Jun/2021:12:34:40 +0000] "GET /css/style.css HTTP/1.1" 200 5381 "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:34:41.338600+00:00 heroku[router]: at=info method=GET path="/fonts/unispacefont/unispace_bd.woff2" host=[REDACTED].herokuapp.com request_id=abe1b487-b1d5-4e69-9ce3-522d71f273a4 fwd="my public IP" dyno=web.1 connect=1ms service=3ms status=200 bytes=19032 protocol=https
2021-06-17T12:34:41.339220+00:00 app[web.1]: 10.45.246.133 - - [17/Jun/2021:12:34:41 +0000] "GET /fonts/unispacefont/unispace_bd.woff2 HTTP/1.1" 200 18796 "https://[REDACTED].herokuapp.com/css/style.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:34:41.342795+00:00 app[web.1]: 10.13.167.33 - - [17/Jun/2021:12:34:41 +0000] "GET /img/background.gif HTTP/1.1" 200 527193 "https://[REDACTED].herokuapp.com/css/style.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:34:41.364937+00:00 heroku[router]: at=info method=GET path="/img/background.gif" host=[REDACTED].herokuapp.com request_id=84347863-b933-4905-806f-cb845841382c fwd="my public IP" dyno=web.1 connect=1ms service=35ms status=200 bytes=527430 protocol=https
2021-06-17T12:34:41.758978+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=[REDACTED].herokuapp.com request_id=6cdc7f4e-2f38-4eba-b68c-01007d056573 fwd="my public IP" dyno=web.1 connect=0ms service=1ms status=200 bytes=231 protocol=https
2021-06-17T12:34:41.764926+00:00 app[web.1]: 10.145.208.41 - - [17/Jun/2021:12:34:41 +0000] "GET /favicon.ico HTTP/1.1" 200 - "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:18.999443+00:00 heroku[router]: at=info method=GET path="/" host=[REDACTED].herokuapp.com request_id=c6fed9d7-927f-47d2-8b7d-d7ae778470ce fwd="my public IP" dyno=web.1 connect=1ms service=34ms status=500 bytes=2276 protocol=https
2021-06-17T12:38:19.001120+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:18 +0000] "GET / HTTP/1.1" 500 2052 "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:19.214613+00:00 heroku[router]: at=info method=GET path="/js/javascript.js" host=[REDACTED].herokuapp.com request_id=dddbe457-5c42-4690-b2bf-668f3fb6fa5b fwd="my public IP" dyno=web.1 connect=1ms service=1ms status=200 bytes=392 protocol=https
2021-06-17T12:38:19.216549+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:19 +0000] "GET /js/javascript.js HTTP/1.1" 200 148 "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:19.328406+00:00 heroku[router]: at=info method=GET path="/css/style.css" host=[REDACTED].herokuapp.com request_id=06c20f54-0efa-467f-a82c-8b0f31c236d1 fwd="my public IP" dyno=web.1 connect=1ms service=1ms status=304 bytes=129 protocol=https
2021-06-17T12:38:19.330477+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:19 +0000] "GET /css/style.css HTTP/1.1" 304 - "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:19.455017+00:00 heroku[router]: at=info method=GET path="/img/background.gif" host=[REDACTED].herokuapp.com request_id=e4786017-356b-4e00-8407-9f5db00aca76 fwd="my public IP" dyno=web.1 connect=1ms service=1ms status=304 bytes=130 protocol=https
2021-06-17T12:38:19.457067+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:19 +0000] "GET /img/background.gif HTTP/1.1" 304 - "https://[REDACTED].herokuapp.com/css/style.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:20.794980+00:00 heroku[router]: at=info method=GET path="/profile" host=[REDACTED].herokuapp.com request_id=7e86eddf-c38f-4350-bc34-a9a21f96d6ce fwd="my public IP" dyno=web.1 connect=1ms service=17ms status=500 bytes=2276 protocol=https
2021-06-17T12:38:20.797031+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:20 +0000] "GET /profile HTTP/1.1" 500 2052 "https://[REDACTED].herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:22.055940+00:00 heroku[router]: at=info method=GET path="/assignments" host=[REDACTED].herokuapp.com request_id=2ba4e41b-c431-4658-b42e-719a47d38895 fwd="my public IP" dyno=web.1 connect=1ms service=25ms status=500 bytes=2276 protocol=https
2021-06-17T12:38:22.057700+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:22 +0000] "GET /assignments HTTP/1.1" 500 2052 "https://[REDACTED].herokuapp.com/profile" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:22.916661+00:00 heroku[router]: at=info method=GET path="/motivatie" host=[REDACTED].herokuapp.com request_id=290562af-a18a-42b1-bd97-34007a70ae9b fwd="my public IP" dyno=web.1 connect=1ms service=11ms status=500 bytes=2276 protocol=https
2021-06-17T12:38:22.918708+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:22 +0000] "GET /motivatie HTTP/1.1" 500 2052 "https://[REDACTED].herokuapp.com/assignments" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:23.758614+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:23 +0000] "GET /beroepsbeeld HTTP/1.1" 500 2052 "https://[REDACTED].herokuapp.com/motivatie" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:38:23.759586+00:00 heroku[router]: at=info method=GET path="/beroepsbeeld" host=[REDACTED].herokuapp.com request_id=689a9d3c-5416-40de-9a4b-6a61ffefb786 fwd="my public IP" dyno=web.1 connect=1ms service=15ms status=500 bytes=2276 protocol=https
2021-06-17T12:38:24.542760+00:00 heroku[router]: at=info method=GET path="/error/503" host=[REDACTED].herokuapp.com request_id=8abe0728-5b95-4935-8dd3-3fd33e326f43 fwd="my public IP" dyno=web.1 connect=1ms service=19ms status=500 bytes=2276 protocol=https
2021-06-17T12:38:24.544759+00:00 app[web.1]: 10.13.238.239 - - [17/Jun/2021:12:38:24 +0000] "GET /error/503 HTTP/1.1" 500 2052 "https://[REDACTED].herokuapp.com/beroepsbeeld" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
2021-06-17T12:40:48.596106+00:00 app[api]: Starting process with command `php -a` by user [REDACTED]
2021-06-17T12:40:52.937251+00:00 heroku[run.9243]: State changed from starting to up
2021-06-17T12:40:53.278275+00:00 heroku[run.9243]: Awaiting client
2021-06-17T12:40:53.311177+00:00 heroku[run.9243]: Starting process with command `php -a`
2021-06-17T12:41:46.949422+00:00 heroku[run.9243]: Process exited with status 255
2021-06-17T12:41:47.020869+00:00 heroku[run.9243]: State changed from up to complete
I honestly have no idea how to grant Heroku the access it wants.
I have successfully integrated the free pgsql database from Heroku into the project from step 11 and I am able to migrate both on the cloud and on the local copy. However, I am unable to seed on the cloud. I suspect this to be related to the issue above.
Class Faker/Factory not found error during seeding:
If your app uses a database, you might configure this first using step 10 and 11 of your tutorial.

Grafana image renderer plugin not working

i have grafana 7.0.5 with image rendrer plugin v2.0
in grafana.ini
root_url = http://myServer.com/grafana
and grafana is running behind an apache with :
ProxyPass /grafana http://127.0.0.1:3000
ProxyPassReverse /grafana http://127.0.01:3000
When i try to render an image of a panle with : [Direct link rendered image], browser wait for about 1 mn and then i have :
in the log file : i have
t=2020-07-08T15:12:46+0200 lvl=info msg=Rendering logger=rendering renderer=plugin path="d-solo/mT2tktqZk/fiche-departementale?orgId=1&from=1594192067086&to=1594213667086&var-liste_dep=All&var-date2_deb=&var-date2_fin=&var-type_et=ETF&var-type_et=ETD&var-type_et=ETVM&var-type_et=ETFR&var-type_et=ETM&var-type_et=ETC&var-type_et=ETT&panelId=6&width=1000&height=500&tz=Europe%2FParis"
t=2020-07-08T15:12:46+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname= method=GET path=/d-solo/mT2tktqZk/fiche-departementale status=200 remote_addr=[::1] time_ms=2 size=34727 referer=
t=2020-07-08T15:12:47+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname= method=GET path=/api/dashboards/uid/mT2tktqZk status=200 remote_addr=[::1] time_ms=2 size=11580 referer="http://localhost:3000/grafana/d-solo/mT2tktqZk/fiche-departementale?orgId=1&from=1594192067086&to=1594213667086&var-liste_dep=All&var-date2_deb=&var-date2_fin=&var-type_et=ETF&var-type_et=ETD&var-type_et=ETVM&var-type_et=ETFR&var-type_et=ETM&var-type_et=ETC&var-type_et=ETT&panelId=6&width=1000&height=500&tz=Europe%2FParis&render=1"
t=2020-07-08T15:12:47+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname= method=POST path=/api/tsdb/query status=200 remote_addr=[::1] time_ms=2 size=927 referer="http://localhost:3000/grafana/d-solo/mT2tktqZk/fiche-departementale?orgId=1&from=1594192067086&to=1594213667086&var-liste_dep=All&var-date2_deb=&var-date2_fin=&var-type_et=ETF&var-type_et=ETD&var-type_et=ETVM&var-type_et=ETFR&var-type_et=ETM&var-type_et=ETC&var-type_et=ETT&panelId=6&width=1000&height=500&tz=Europe%2FParis&render=1"
t=2020-07-08T15:12:48+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname= method=POST path=/api/tsdb/query status=400 remote_addr=[::1] time_ms=2 size=1798 referer="http://localhost:3000/grafana/d-solo/mT2tktqZk/fiche-departementale?orgId=1&from=1594192067086&to=1594213667086&var-liste_dep=All&var-date2_deb=&var-date2_fin=&var-type_et=ETF&var-type_et=ETD&var-type_et=ETVM&var-type_et=ETFR&var-type_et=ETM&var-type_et=ETC&var-type_et=ETT&panelId=6&width=1000&height=500&tz=Europe%2FParis&render=1"
t=2020-07-08T15:12:48+0200 lvl=eror msg="Browser console error" logger=plugins.backend pluginId=grafana-image-renderer msg="Failed to load resource: the server responded with a status of 400 (Bad Request)" url=http://localhost:3000/grafana/api/tsdb/query
t=2020-07-08T15:13:48+0200 lvl=info msg="Rendering timed out" logger=rendering renderer=plugin
t=2020-07-08T15:13:48+0200 lvl=eror msg="Timeout error. You can set timeout in seconds with &timeout url parameter" logger=context userId=1 orgId=1 uname=admin error="Timeout error. You can set timeout in seconds with &timeout url parameter"
t=2020-07-08T15:13:48+0200 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/mT2tktqZk/fiche-departementale status=500 remote_addr="193.41.223.244, 192.168.255.162" time_ms=62022 size=1791 referer="https://sigdca.rct01.kleegroup.com/grafana/d/mT2tktqZk/fiche-departementale?orgId=1"
t=2020-07-08T15:13:49+0200 lvl=eror msg="Render request failed" logger=plugins.backend pluginId=grafana-image-renderer url="http://localhost:3000/grafana/d-solo/mT2tktqZk/fiche-departementale?orgId=1&from=1594192067086&to=1594213667086&var-liste_dep=All&var-date2_deb=&var-date2_fin=&var-type_et=ETF&var-type_et=ETD&var-type_et=ETVM&var-type_et=ETFR&var-type_et=ETM&var-type_et=ETC&var-type_et=ETT&panelId=6&width=1000&height=500&tz=Europe%2FParis&render=1" error="TimeoutError: waiting for function failed: timeout 60000ms exceeded"
Can i get some help with this plz, i’m stuck
Provide the values as follows
GF_RENDERING_SERVER_URL: http://myServer.com/render
GF_RENDERING_CALLBACK_URL: http://myServer.com/grafana
the error came from the dashboard SQL query, so when you try to render a dashboard with an error in its SQL query it fails rendering.

What could be causing this heroku crash? error code=H10

I've looked over past posts on this question and many suggest heroku restart, or restarting dynos, or making sure to use var PORT = process.env.PORT || 3000. I have done all of these, but my app still crashes. The app runs using node/express sequelize / auth0.
Does any one have any suggestions? Thanks!
Here are the logs:
2017-09-08T02:11:37.293051+00:00 app[web.1]: at emitOne
(events.js:96:13)
2017-09-08T02:11:37.293052+00:00 app[web.1]: at Socket.emit
(events.js:188:7)
2017-09-08T02:11:37.293053+00:00 app[web.1]: at emitErrorNT
(net.js:1277:8)
2017-09-08T02:11:37.293054+00:00 app[web.1]: at
_combinedTickCallback (internal/process/next_tick.js:80:11)
2017-09-08T02:11:37.293055+00:00 app[web.1]: at
process._tickCallback (internal/process/next_tick.js:104:9)
2017-09-08T02:11:37.364314+00:00 heroku[web.1]: State changed from
starting to crashed
2017-09-08T02:11:37.353673+00:00 heroku[web.1]: Process exited with
status 0
2017-09-08T02:11:49.712881+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/" host=roadie2.herokuapp.com
request_id=79e0bc3a-aa28-44bb-ab80-cfcf4f6cd97d fwd="99.92.51.34"
dyno= connect= service= status=503 bytes= protocol=https
2017-09-08T02:11:50.564503+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=roadie2.herokuapp.com request_id=c72e5077-494c-41f5-8be1-
f0c2c329d080 fwd="99.92.51.34" dyno= connect= service= status=503
bytes= protocol=https
2017-09-08T02:12:24.838901+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/" host=roadie2.herokuapp.com
request_id=ca551858-5372-40c9-abf1-670176b159dc fwd="99.92.51.34"
dyno= connect= service= status=503 bytes= protocol=https
2017-09-08T02:12:25.340624+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=roadie2.herokuapp.com request_id=c37b876d-5a59-40d0-9d59-
9be013c58d94 fwd="99.92.51.34" dyno= connect= service= status=503
bytes= protocol=https
Here is the last part of what results after entering heroku logs --tail
2017-09-08T02:11:27.589912+00:00 heroku[web.1]: State changed from
crashed to starting
2017-09-08T02:11:29.599921+00:00 heroku[web.1]: Starting process with
command `npm start`
2017-09-08T02:11:32.504222+00:00 app[web.1]:
2017-09-08T02:11:32.504242+00:00 app[web.1]: > 15.2#1.0.0 start /app
2017-09-08T02:11:32.504243+00:00 app[web.1]: > node server.js
2017-09-08T02:11:32.504243+00:00 app[web.1]:
2017-09-08T02:11:33.199936+00:00 app[web.1]: Unhandled rejection
SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
2017-09-08T02:11:33.199952+00:00 app[web.1]: at
Handshake._callback
(/app/node_modules/sequelize/lib/dialects/mysql/connection-
manager.js:80:20)
2017-09-08T02:11:33.199953+00:00 app[web.1]: at
Protocol.handleNetworkError
(/app/node_modules/mysql/lib/protocol/Protocol.js:364:14)
2017-09-08T02:11:33.199953+00:00 app[web.1]: at
Connection._handleNetworkError
(/app/node_modules/mysql/lib/Connection.js:428:18)
2017-09-08T02:11:33.199954+00:00 app[web.1]: at emitOne
(events.js:96:13)
2017-09-08T02:11:33.199952+00:00 app[web.1]: at
Handshake.Sequence.end
(/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:86:24)
2017-09-08T02:11:33.199954+00:00 app[web.1]: at Socket.emit
(events.js:188:7)
2017-09-08T02:11:33.199955+00:00 app[web.1]: at emitErrorNT
(net.js:1277:8)
2017-09-08T02:11:33.199956+00:00 app[web.1]: at
_combinedTickCallback (internal/process/next_tick.js:80:11)
2017-09-08T02:11:33.199956+00:00 app[web.1]: at
process._tickCallback (internal/process/next_tick.js:104:9)
2017-09-08T02:11:33.302346+00:00 heroku[web.1]: State changed from
starting to crashed
2017-09-08T02:11:33.305267+00:00 heroku[web.1]: State changed from .
crashed to starting
2017-09-08T02:11:33.286200+00:00 heroku[web.1]: Process exited with .
status 0
2017-09-08T02:11:34.845606+00:00 heroku[web.1]: Starting process with
command `npm start`
2017-09-08T02:11:36.543285+00:00 app[web.1]:
2017-09-08T02:11:36.543298+00:00 app[web.1]: > 15.2#1.0.0 start /app
2017-09-08T02:11:36.543299+00:00 app[web.1]: > node server.js
2017-09-08T02:11:36.543299+00:00 app[web.1]:
2017-09-08T02:11:37.293030+00:00 app[web.1]: Unhandled rejection .
SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
2017-09-08T02:11:37.293048+00:00 app[web.1]: at
Handshake._callback .
(/app/node_modules/sequelize/lib/dialects/mysql/connection-
manager.js:80:20)
2017-09-08T02:11:37.293049+00:00 app[web.1]: at
Handshake.Sequence.end
(/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:86:24)
2017-09-08T02:11:37.293049+00:00 app[web.1]: at .
Protocol.handleNetworkError
(/app/node_modules/mysql/lib/protocol/Protocol.js:364:14)
2017-09-08T02:11:37.293050+00:00 app[web.1]: at
Connection._handleNetworkError
(/app/node_modules/mysql/lib/Connection.js:428:18)
2017-09-08T02:11:37.293051+00:00 app[web.1]: at emitOne
(events.js:96:13)
2017-09-08T02:11:37.293052+00:00 app[web.1]: at Socket.emit
(events.js:188:7)
2017-09-08T02:11:37.293053+00:00 app[web.1]: at emitErrorNT
(net.js:1277:8)
2017-09-08T02:11:37.293054+00:00 app[web.1]: at
_combinedTickCallback (internal/process/next_tick.js:80:11)
2017-09-08T02:11:37.293055+00:00 app[web.1]: at
process._tickCallback (internal/process/next_tick.js:104:9)
2017-09-08T02:11:37.364314+00:00 heroku[web.1]: State changed from
starting to crashed
2017-09-08T02:11:37.353673+00:00 heroku[web.1]: Process exited with .
status 0
2017-09-08T02:11:49.712881+00:00 heroku[router]: at=error code=H10 .
desc="Appcrashed" method=GET path="/" host=roadie2.herokuapp.com
request_id=79e0bc3a-aa28-44bb-ab80-cfcf4f6cd97d fwd="99.92.51.34"
dyno= connect= service= status=503 bytes= protocol=https
2017-09-08T02:11:50.564503+00:00 heroku[router]: at=error code=H10
desc="Appcrashed" method=GET path="/favicon.ico"
host=roadie2.herokuapp.com request_id=c72e5077-494c-41f5-8be1-
f0c2c329d080 fwd="99.92.51.34" dyno= connect= service= status=503
bytes= protocol=https
2017-09-08T02:12:24.838901+00:00 heroku[router]: at=error code=H10 .
desc="Appcrashed" method=GET path="/" host=roadie2.herokuapp.com
request_id=ca551858-5372-40c9-abf1-670176b159dc fwd="99.92.51.34"
dyno= connect= service= status=503 bytes= protocol=https
2017-09-08T02:12:25.340624+00:00 heroku[router]: at=error code=H10
desc="Appcrashed" method=GET path="/favicon.ico"
host=roadie2.herokuapp.com request_id=c37b876d-5a59-40d0-9d59-
9be013c58d94 fwd="99.92.51.34" dyno= connect= service= status=503
bytes= protocol=https
config.json
{
"development": {
"username": "root",
"password":"",
"database": "roadie2",
"host": "127.0.0.1",
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"use_env_variable": "JAWSDB_URL",
"dialect": "mysql"
}
}
server.js
var express = require("express");
var bodyParser = require("body-parser");
// Sets up the Express App
// =============================================================
var app = express();
// var PORT = process.env.PORT || 3000;
var port = process.env.PORT
// Requiring our models for syncing
var db = require("./models");
// Sets up the Express app to handle data parsing
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.text());
app.use(bodyParser.json({ type: "application/vnd.api+json" }));
// Static directory
app.use(express.static("./public"));
// Routes =============================================================
require("./routes/html-routes.js")(app);
require("./routes/api-routes.js")(app);
// Syncing our sequelize models and then starting our express app
db.sequelize.sync().then(function() {
app.listen(port, function() {
console.log("App listening on PORT " + port);
});
});
models/index.js
'use strict';
var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var basename = path.basename(module.filename);
var env = process.env.NODE_ENV || 'development';
var config = require(__dirname + '/../config/config.json')[env];
var db = {};
if (config.use_env_variable) {
var sequelize = new
Sequelize(process.env[config.use_env_variable]);
} else {
var sequelize = new Sequelize(config.database, config.username,
config.password, config);
}
fs
.readdirSync(__dirname)
.filter(function(file) {
return (file.indexOf('.') !== 0) && (file !== basename) &&
(file.slice(-3) === '.js');
})
.forEach(function(file) {
var model = sequelize['import'](path.join(__dirname, file));
db[model.name] = model;
});
Object.keys(db).forEach(function(modelName) {
if (db[modelName].associate) {
db[modelName].associate(db);
}
});
db.sequelize = sequelize;
db.Sequelize = Sequelize;
module.exports = db;
https://devcenter.heroku.com/articles/error-codes#h10-app-crashed
Your logs clearly tell you why it's crash:
2017-09-08T02:11:37.293030+00:00 app[web.1]: Unhandled rejection .
SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
You are unable to connect to your SQL server.
From the looks of it, you seemed to be trying to connect to 127.0.0.1:3306 which will not work. 127.0.0.1 or localhost is your local IP.
You need to either setup/connect to Heroku's Postgres addon or use an external SQL service such as Amazon RDS.

WSO2 API Manager - Auth Type "None" leads to APISecurityException

I am trying to use my API through the Swagger UI through the WSO2 API Manager:
Me->Browser->SwaggerUI->WSO2->MyBackend
Now I got the problem, that Swagger UI always gives me:
{ "error": "no response from server" }
I was making some research and figured out, that the Problem here is associated to CORS. While I am attempting a GET request, the Firefox sends an OPTION request first (because of CORS) to the WSO2 gateway.
Now the same scenario is explained and described here as well:
https://wso2.org/jira/browse/APIMANAGER-1819
The solution/workarounds described in the links is, that in the API publisher you have to create an endpoint for the requested resource with method OPTION and to set the auth type of that OPTION endpoint to "none".
However this doesn't work for me, since I get an exception in WSO, when the request is passed in.
The HTTP Request going into WSO2:
TID: [0] [AM] [2015-05-07 09:32:50,707] DEBUG {org.apache.synapse.transport.http.wire} - >> "OPTIONS /bankapi/v1/cashAccounts HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,707] DEBUG {org.apache.synapse.transport.http.wire} - >> "Host: 10.88.13.104:8243[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,707] DEBUG {org.apache.synapse.transport.http.wire} - >> "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,707] DEBUG {org.apache.synapse.transport.http.wire} - >> "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,708] DEBUG {org.apache.synapse.transport.http.wire} - >> "Accept-Language: en-US,en;q=0.5[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,708] DEBUG {org.apache.synapse.transport.http.wire} - >> "Accept-Encoding: gzip, deflate[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,708] DEBUG {org.apache.synapse.transport.http.wire} - >> "Origin: http://10.88.13.104:8080[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,708] DEBUG {org.apache.synapse.transport.http.wire} - >> "Access-Control-Request-Method: GET[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,708] DEBUG {org.apache.synapse.transport.http.wire} - >> "Connection: keep-alive[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [AM] [2015-05-07 09:32:50,708] DEBUG {org.apache.synapse.transport.http.wire} - >> "[\r][\n]" {org.apache.synapse.transport.http.wire}
The exception and stack trace:
TID: [0] [AM] [2015-05-07 09:32:50,878] ERROR {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} - API authentication failure {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /bankapi, version: v1 with key: null
at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.java:212)
at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHandler.java:94)
at org.apache.synapse.rest.API.process(API.java:284)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:83)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:64)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:344)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
The important thing here is 2.... there is an error while authenticating even though the auth type is none and the authentication should always be successful. The request is not even forwarded to the backend (this is why my question is not a duplicate, but there is a very different problem underlying).
I am running WSO2 API Manager in version 1.8.0 on Windows (the binary package you can download on the WSO2 site).
Can you help me out here? Am I missing something? Is this a plain bug (it looks to me that way)?

WCF in IIS 6: Server cannot set status after HTTP headers have been sent

I have a WCF service that is essentially running in a loop and outputting files to a directory.
I am getting this interesting error that I managed to find with tracing enabled
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524340</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2010-03-06T14:06:35.3593750Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{f133e2e7-d86a-4ce3-8e4a-427e502817d0}" />
<Execution ProcessName="w3wp" ProcessID="2036" ThreadID="5" />
<Channel />
<Computer>SLOW</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.ServiceOperationExceptionOnReply.aspx</TraceIdentifier>
<Description>Replying to an operation threw a exception.</Description>
<AppDomain>/LM/W3SVC/1/Root/ISDS-1-129123577914375000</AppDomain>
<Source>System.ServiceModel.Dispatcher.ImmutableDispatchRuntime/38732823</Source>
<Exception>
<ExceptionType>System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</ExceptionType>
<Message>Server cannot set status after HTTP headers have been sent.</Message>
<StackTrace>
at System.Web.HttpResponse.set_StatusCode(Int32 value)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.SetStatusCode(Int32 statusCode)
at System.ServiceModel.Channels.HttpOutput.HostedRequestHttpOutput.PrepareHttpSend(Message message)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Activation.HostedHttpContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc& rpc)
</StackTrace>
<ExceptionString>System.Web.HttpException: Server cannot set status after HTTP headers have been sent.
at System.Web.HttpResponse.set_StatusCode(Int32 value)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.SetStatusCode(Int32 statusCode)
at System.ServiceModel.Channels.HttpOutput.HostedRequestHttpOutput.PrepareHttpSend(Message message)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Activation.HostedHttpContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc& rpc)</ExceptionString>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
I have no idea what is causing this issue, any ideas where to begin trying to fix this?
Thanks in advance.
When the service sends the response it starts by building and then sending the response in packets. The first thing to be sent back to the client is the http headers, once the headers have been sent on the network, it is not possible to change them.
You probably have some code that runs too late in the process.