How to avoid terminal to catch error instead of Symfony profiler - symfony

[edited on 19th june] The question is not regarding the content of the logs, but why logs doesn't not appear in my symfony profiler
My symfony profiler doesn't display any error log but my php built-in-server seems to catch them and display them in my terminal.
To run my built-in web server, i'm using the following command: php bin/console server:run with no extra parameters
the output in my terminal is something like:
2019-06-19T07:23:21+00:00 [info] Matched route "overblog_graphql_endpoint".
2019-06-19T07:23:21+00:00 [debug] Checking for guard authentication credentials.
2019-06-19T07:23:21+00:00 [debug] Checking support on guard authenticator.
2019-06-19T07:23:21+00:00 [debug] Calling getCredentials() on guard authenticator.
2019-06-19T07:23:21+00:00 [info] Guard authentication failed.
2019-06-19T07:23:21+00:00 [debug] The "Lexik\Bundle\JWTAuthenticationBundle\Security\Guard\JWTTokenAuthenticator" authenticator set the response. Any later authenticator will not be called
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Overblog\GraphQLBundle\EventListener\ClassLoaderListener::load".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\ResolveControllerNameSubscriber::onKernelRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest".
2019-06-19T07:23:21+00:00 [debug] Listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest" stopped propagation of the event "kernel.request".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\Security\Http\RememberMe\ResponseListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\StreamedResponseListener::onKernelResponse".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelFinishRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onFinishRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelFinishRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.finish_request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelFinishRequest".
2019-06-19T07:23:21+00:00 [debug] Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTerminate".
[Wed Jun 19 09:23:21 2019] 127.0.0.1:60635 [401]: /
When I check my symfony profiler, i got this empty screen:
(source: i.ibb.co)
I remember long time ago, I run a command in my terminal to change the verbosity, but I'm unfortunately unable to remember which one was it to revert it. And I think this is the reason why the terminal is displaying the log info instead of my symfony profiler
Is there someone who can help me ?

There is no error shown in your output from terminal. It states that authentication failed and it won't let your HTTP request pass security component. That's why you are getting HTTP response 401 Unauthorized.
2019-06-19T07:23:21+00:00 [info] Guard authentication failed.
2019-06-19T07:23:21+00:00 [debug] The "Lexik\Bundle\JWTAuthenticationBundle\Security\Guard\JWTTokenAuthenticator" authenticator set the response. Any later authenticator will not be called
You have issue in your application security config which is not letting any request through. That's why Symfony profiler is empty and why you cannot reach the website. Though this is not an Exception which could be thrown. It's simply required behavior based on your particular config and sent request.
Also any change to verbosity of the command (parameter -v[vv]) is not permanent and is relevant only during the run of that particular command.

ok, i was just missing monolog (composer require symfony/monolog-bundle)
By doing so, my terminal only show this:
[Wed Jun 19 11:56:26 2019] 127.0.0.1:53057 [200]: /graphiql
[Wed Jun 19 11:56:27 2019] 127.0.0.1:53058 [200]: /
[Wed Jun 19 11:56:28 2019] 127.0.0.1:53059 [200]: /_wdt/ddb809
[Wed Jun 19 11:56:30 2019] 127.0.0.1:53062 [200]: /graphiql
[Wed Jun 19 11:56:30 2019] 127.0.0.1:53063 [200]: /
[Wed Jun 19 11:56:30 2019] 127.0.0.1:53065 [200]: /_wdt/4f2a47
[Wed Jun 19 11:56:33 2019] 127.0.0.1:53068 [200]: /
[Wed Jun 19 11:56:42 2019] 127.0.0.1:53074 [200]: /_profiler/ea688f
[Wed Jun 19 11:56:43 2019] 127.0.0.1:53075 [200]: /_profiler/ea688f?panel=logger
and my logs are appearing normally in my symfony profiler

Related

firebase projects:list fails to list projects even though firebase login has succeeded

I am trying to set up firebase for a Flutter app. I have successfully logged in using the firebase cli. But when I run
flutterfire configure
I get the following error in the debug log:
[debug] [2022-03-05T10:44:24.286Z] ----------------------------------------------------------------------
[debug] [2022-03-05T10:44:24.287Z] Command: /usr/local/bin/firebase /home/madlad/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase projects:list --json
[debug] [2022-03-05T10:44:24.287Z] CLI Version: 10.2.2
[debug] [2022-03-05T10:44:24.287Z] Platform: linux
[debug] [2022-03-05T10:44:24.287Z] Node Version: v12.18.1
[debug] [2022-03-05T10:44:24.287Z] Time: Sat Mar 05 2022 16:14:24 GMT+0530 (India Standard Time)
[debug] [2022-03-05T10:44:24.287Z] ----------------------------------------------------------------------
[debug]
[debug] [2022-03-05T10:44:24.291Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2022-03-05T10:44:24.291Z] > authorizing via FIREBASE_TOKEN environment variable
[debug] [2022-03-05T10:44:24.293Z] > refreshing access token with scopes: []
[debug] [2022-03-05T10:44:24.293Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2022-03-05T10:44:24.475Z] <<< HTTP RESPONSE 400 {"expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","date":"Sat, 05 Mar 2022 10:44:24 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2022-03-05T10:44:24.484Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
[debug] [2022-03-05T10:44:24.722Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 401
[debug] [2022-03-05T10:44:24.722Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[debug] [2022-03-05T10:44:24.724Z] HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[debug] [2022-03-05T10:44:24.891Z] FirebaseError: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
at module.exports (/home/madlad/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/responseToError.js:47:12)
at RetryOperation._fn (/home/madlad/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:286:39)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.
The existing solutions say try logging out and logging in again or firebase login --reauth. I have tried both of them and none of them are working.

error: Failed to list Firebase projects. See firebase-debug.log for more info

I was tying to create firestore web app by following the link https://firebase.google.com/codelabs/firestore-web#3
I came to 3rd lesson and I stuck at the below npm code
I have used firebase use --add
to list the projects.
I got the below error as firebase-console.log
**[debug] [2021-03-04T08:25:39.308Z] ----------------------------------------------------------------------
[debug] [2021-03-04T08:25:39.312Z] Command: C:\Program Files\nodejs\node.exe C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js use --add
[debug] [2021-03-04T08:25:39.312Z] CLI Version: 9.5.0
[debug] [2021-03-04T08:25:39.313Z] Platform: win32
[debug] [2021-03-04T08:25:39.313Z] Node Version: v12.18.0
[debug] [2021-03-04T08:25:39.315Z] Time: Thu Mar 04 2021 13:55:39 GMT+0530 (India Standard Time)
[debug] [2021-03-04T08:25:39.315Z] ----------------------------------------------------------------------
[debug] [2021-03-04T08:25:39.316Z]
[debug] [2021-03-04T08:25:39.328Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2021-03-04T08:25:39.329Z] > authorizing via signed-in user
[debug] [2021-03-04T08:25:39.336Z] > refreshing access token with scopes: []
[debug] [2021-03-04T08:25:39.338Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2021-03-04T08:25:42.275Z] <<< HTTP RESPONSE 400 {"expires":"Mon, 01 Jan 1990 00:00:00 GMT","date":"Thu, 04 Mar 2021 08:25:41 GMT","pragma":"no-cache","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2021-03-04T08:25:42.279Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
[debug] [2021-03-04T08:25:43.402Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 401
[debug] [2021-03-04T08:25:43.403Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[debug] [2021-03-04T08:25:43.403Z] HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[debug] [2021-03-04T08:25:44.116Z] FirebaseError: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
at module.exports (C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:38:12)
at Client.doRequest (C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:238:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Client.request (C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:96:20)
at async getProjectPage (C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\management\projects.js:232:17)
at async getFirebaseProjectPage (C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\management\projects.js:249:23)
at async listFirebaseProjects (C:\Users\BKRK\AppData\Roaming\npm\node_modules\firebase-tools\lib\management\projects.js:280:29)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.**
just type in the terminal
firebase login --reauth
should open the browser and log in to your account again, it worked for me.

Firebase cli throws Error: Server Error. connect ETIMEDOUT on every command

I checked all the answers to this question on stack overflow. But all of them occurred due to some other reasons.
Well,
I was trying to deploy some database rules and started getting this error. And later on when i tried to do anything i realized that none of the firebase commands work and throws the same error again and again.
what all i tried :
updates firebase tools to latest version
reset my internet connection
firebase login --reauth
but no luck.
here are the logs
[debug] [2018-12-25T05:41:52.644Z] ----------------------------------------------------------------------
[debug] [2018-12-25T05:41:52.648Z] Command: C:\Program Files\nodejs\node.exe C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js list
[debug] [2018-12-25T05:41:52.649Z] CLI Version: 6.2.2
[debug] [2018-12-25T05:41:52.649Z] Platform: win32
[debug] [2018-12-25T05:41:52.649Z] Node Version: v8.12.0
[debug] [2018-12-25T05:41:52.650Z] Time: Tue Dec 25 2018 11:11:52 GMT+0530 (India Standard Time)
[debug] [2018-12-25T05:41:52.650Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-12-25T05:41:52.673Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2018-12-25T05:41:52.674Z] > authorizing via signed-in user
[debug] [2018-12-25T05:41:52.677Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2018-12-25T05:41:52.678Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2018-12-25T05:41:53.273Z] <<< HTTP RESPONSE 200
[debug] [2018-12-25T05:41:53.336Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
[debug] [2018-12-25T05:42:14.888Z] Error: connect ETIMEDOUT 104.197.85.31:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
[error]
[error] Error: Server Error. connect ETIMEDOUT 104.197.85.31:443
Please suggest whatever you know about the issue.
npm i -g firebase-tools
Updating firebase tools worked for me.
then, try again firebase deploy.
if it still didn't work try clearing the firebase cache which is the .firebase file

Firebase deploy command just hangs

I'm new to Firebase and this is my first attempt to deploy a Vue app.
What I'm doing is
'firebase init' in my project directory, with the dist folder chosen as default (instead of public recommended in documentation)
'firebase deploy' in my project directory
So, nothing happens. In the firebase-debug.log I see there are some successful connections but then the process just hangs
[debug] [2018-04-23T08:02:20.680Z] ----------------------------------------------------------------------
[debug] [2018-04-23T08:02:20.683Z] Command: C:\Users\---\scoop\apps\nodejs\current\node.exe C:\Users\---\scoop\apps\nodejs\current\bin\node_modules\firebase-tools\bin\firebase deploy
[debug] [2018-04-23T08:02:20.683Z] CLI Version: 3.18.4
[debug] [2018-04-23T08:02:20.683Z] Platform: win32
[debug] [2018-04-23T08:02:20.683Z] Node Version: v9.3.0
[debug] [2018-04-23T08:02:20.684Z] Time: Mon Apr 23 2018 11:02:20 GMT+0300 (RTZ 2 (╨╖╨╕╨╝╨░))
[debug] [2018-04-23T08:02:20.684Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-04-23T08:02:20.694Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2018-04-23T08:02:20.694Z] > authorizing via signed-in user
[debug] [2018-04-23T08:02:20.696Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/my-project some - id
Mon Apr 23 2018 11:02:20 GMT+0300 (RTZ 2 (╨╖╨╕╨╝╨░))
[debug] [2018-04-23T08:02:21.666Z] <<< HTTP RESPONSE 200
[debug] [2018-04-23T08:02:21.667Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/my-project some - id/tokens
Mon Apr 23 2018 11:02:21 GMT+0300 (RTZ 2 (╨╖╨╕╨╝╨░))
[debug] [2018-04-23T08:02:22.906Z] <<< HTTP RESPONSE 200

firebase init gives EPROTO error

Running firebase init command gives an EPROTO error. Same error when I try firebase list. I can successfully use firebase login though. Here is the output of the firebase.debug.log:
[debug] ----------------------------------------------------------------------
[debug] Command: C:\Program Files\nodejs\node.exe C:\Users\andre\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase init
[debug] CLI Version: 3.13.1
[debug] Platform: win32
[debug] Node Version: v8.8.1
[debug] Time: Sat Oct 28 2017 12:35:18 GMT+0100 (GMT Summer Time)
[debug] ----------------------------------------------------------------------
[debug]
[debug] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
[debug] [2017-10-28T11:35:18.899Z] > authorizing via signed-in user
You're about to initialize a Firebase project in this directory:
C:\Users\andre\Documents\cake-poly20-test
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '<token>',
client_id: '<clientid>.apps.googleusercontent.com',
client_secret: '<secret>',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Sat Oct 28 2017 12:35:25 GMT+0100 (GMT Summer Time)
[debug] <<< HTTP RESPONSE 200
[debug] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
Sat Oct 28 2017 12:35:25 GMT+0100 (GMT Summer Time)
[debug] Error: write EPROTO 101057795:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):openssl\ssl\s23_clnt.c:772:
at _errnoException (util.js:1024:11)
at WriteWrap.afterWrite [as oncomplete] (net.js:870:14)
[error]
[error] Error: Server Error. write EPROTO 101057795:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):openssl\ssl\s23_clnt.c:772:
Cause:
Eventually I found that my ISP had updated its so-called Kids Safe security settings and was treating admin.firebase.com as a blocked file sharing site.
Solution:
I updated my settings in the ISPs config, so that access to firebase.com was always allowed. Now firebase init, firebase list etc are working fine.

Resources