I have a 140MB file that fails to upload on my nginx.
I have the following directives set in nginx.conf inside the 'server{}` block.
send_timeout 30m;
proxy_read_timeout 30m;
client_max_body_size 10g;
keepalive_timeout 0;
lingering_timeout 3m;
Smaller files are uploading. When I turned debug logs on, I see these lines in the last few statements:
[debug] 5291#0: epoll timer: -1
[debug] 4714#0: child: 3 5292 e:0 t:0 d:0 r:1 j:0
[debug] 4714#0: sigsuspend
[debug] 5292#0: epoll: fd:15 ev:0001 d:00007F9F294E72C8
[debug] 5292#0: channel: 32
[debug] 5292#0: channel command: 2
[debug] 5292#0: close channel s:0 pid:4990 our:4990 fd:10
[debug] 5292#0: channel: 32
[debug] 5292#0: channel command: 2
[debug] 5292#0: close channel s:1 pid:4991 our:4991 fd:12
[debug] 5292#0: channel: -2
[debug] 5292#0: timer delta: 141
[debug] 5292#0: worker cycle
[debug] 5292#0: epoll timer: -1
[debug] 5292#0: worker cycle
[debug] 5292#0: epoll timer: -1
Fix was to set this directive:
http2_recv_timeout 3m;
My client connection was slow which is why the file was not getting uploaded to the server.
I'm using nginx version 1.22.2
In my case it was not about the client or server configurations. It was about cloudflare not allowing uploads more than 100MB in their free plan.
Related
I'm trying to build a location block that serves files from the /tmp directory, but only ones that do not end with a .txt extension.
For now I have this :
location ~^\/temporary(?!.*\.txt$)(.*)$ {
root /tmp;
try_files $1 =404;
}
The problem is I only get 404s, even though the file I'm asking for exists. I used a little debug to make sure of that, here's the debug dump for the "/temporary/test.html" URI:
022/07/17 19:53:42 [debug] 6408#0: *1 http script capture: "/test.html"
2022/07/17 19:53:42 [debug] 6408#0: *1 trying to use file: "/test.html" "/tmp/test.html"
2022/07/17 19:53:42 [debug] 6408#0: *1 trying to use file: "=404" "/tmp=404"
2022/07/17 19:53:42 [debug] 6408#0: *1 http finalize request: 404, "/temporary/test.html?" a:1, c:1
2022/07/17 19:53:42 [debug] 6408#0: *1 http special response: 404, "/temporary/test.html?"
2022/07/17 19:53:42 [debug] 6408#0: *1 http set discard body
2022/07/17 19:53:42 [debug] 6408#0: *1 HTTP/1.1 404 Not Found
As you can see the server actually tried to read the /tmp/test.html file, so the path crafting has worked.
Also the file exists and is readable as shown with this command :
sudo -u nobody stat /tmp/test.html
File: /tmp/test.html
Size: 15 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 2097220 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ nobody) Gid: ( 1000/ user)
Access: 2022-07-17 19:26:19.701542983 +0300
Modify: 2022-07-17 19:53:17.923305174 +0300
Change: 2022-07-17 19:53:17.923305174 +0300
Birth: 2022-07-17 19:26:19.701542983 +0300
What am I missing ?
Okay so apparently the /tmp directory was the origin of the problem. When I tried another directory everything worked as expected for some reason.
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.
I recently migrated to firebase-crashlytics-gradle from the deprecated Fabric library. It works properly on the local machine with these commands:
chmod +x ./gradlew
./gradlew clean
./gradlew assembleApplicationQa appDistributionUploadApplicationQa --debug
however, this is not working on the ubuntu container in the code build pipeline on AWS. The error that is showing is this one:
* What went wrong:
00:32:26.407 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution
failed for task ':app:uploadCrashlyticsMappingFileApplicationQa'.
00:32:26.407 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] >
java.io.FileNotFoundException:
/codebuild/output/src160981101/src/application/app/build/outputs/mapping/application/qa/mapping.txt
(No such file or directory)
00:32:26.407 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
I found that on the local there is a process in that task that is not happening con the ubuntu container: that is this one which seems like is reaching the Crashlytics server and uploads the file properly:
18:58:46.217 [DEBUG] [com.google.firebase.crashlytics] Uploading Mapping File [mappingFile: /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/outputs/mapping/Application/qa/mapping.txt; mappingFileId: 764dc9b417f249f08823552e8e240186;packageName: com.Application.android.qa; googleAppId: 1:775166595613:android:604478ccade98840]
18:58:46.218 [DEBUG] [com.google.firebase.crashlytics] Zipping mapping file: /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/outputs/mapping/Application/qa/mapping.txt -> /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/crashlytics/ApplicationQa/mappings/764dc9b417f249f08823552e8e240186.gz
18:58:46.697 [DEBUG] [com.google.firebase.crashlytics] PUT file: /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/crashlytics/ApplicationQa/mappings/764dc9b417f249f08823552e8e240186.gz to URL: https://firebasecrashlyticssymbols.googleapis.com/v1/project/-/app/1:775166595613:android:604478ccade98840/upload/java/764dc9b417f249f08823552e8e240186
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] PUT headers:
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] User-Agent = crashlytics-gradle/2.0.0
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] X-CRASHLYTICS-API-CLIENT-TYPE = crashlytics-gradle
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] X-CRASHLYTICS-API-CLIENT-VERSION = 2.0.0
18:58:46.698 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
18:58:46.698 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
18:58:46.699 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://firebasecrashlyticssymbols.googleapis.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
18:58:46.699 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 8][route: {s}->https://firebasecrashlyticssymbols.googleapis.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
18:58:46.699 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://firebasecrashlyticssymbols.googleapis.com:443
18:58:46.759 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to firebasecrashlyticssymbols.googleapis.com/142.250.113.95:443
18:58:46.759 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to firebasecrashlyticssymbols.googleapis.com/142.250.113.95:443 with timeout 0
18:58:46.811 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1.2, TLSv1.1, TLSv1]
18:58:46.811 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
18:58:46.811 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
18:58:46.870 [DEBUG] [jdk.event.security] ValidationChain: 7087067, 1544128074,234213421
18:58:46.925 [DEBUG] [jdk.event.security] TLSHandshake: firebasecrashlyticssymbols.googleapis.com:443, TLSv1.2, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 1528437816
18:58:46.925 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established
18:58:46.925 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated protocol: TLSv1.2
18:58:46.925 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
18:58:46.926 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer principal: CN=upload.video.google.com, O=Google LLC, L=Mountain View, ST=California, C=US
18:58:46.926 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer alternative names: [upload.video.google.com, *.clients.google.com, *.docs.google.com, *.drive.google.com, *.gdata.youtube.com, *.googleapis.com, *.photos.google.com, *.upload.google.com, *.upload.youtube.com, *.youtube-3rd-party.com, upload.google.com, upload.youtube.com, uploads.stage.gdata.youtube.com]
18:58:46.926 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] issuer principal: CN=GTS CA 1O1, O=Google Trust Services, C=US
18:58:46.926 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 192.168.0.9:61946<->142.250.113.95:443
18:58:46.926 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request PUT /v1/project/-/app/1:775166595613:android:604478ccade98840/upload/java/764dc9b417f249f08823552e8e240186 HTTP/1.1
18:58:46.926 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
18:58:46.926 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
18:58:51.688 [LIFECYCLE] [org.gradle.process.internal.health.memory.MemoryManager]
18:58:51.688 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 17179869184, Free: 6186242048}
18:58:51.688 [DEBUG] [org.gradle.launcher.daemon.server.health.LowMemoryDaemonExpirationStrategy] Received memory status update: {Total: 17179869184, Free: 6186242048}
18:58:51.688 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 3817865216, Committed: 3571974144}
18:58:48.233 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
18:58:48.233 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:uploadCrashlyticsMappingFileAppicationQa
18:58:53.416 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
18:58:53.416 [DEBUG] [com.google.firebase.crashlytics] PUT response: [reqId=null] 200
18:58:53.416 [INFO] [com.google.firebase.crashlytics] Mapping file uploaded: /Users/hernandez/Desktop/Repo/Appicationandroid/Appication/app/build/outputs/mapping/Appication/qa/mapping.txt
18:58:53.416 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa'
18:58:53.417 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa' completed
18:58:53.417 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
18:58:53.417 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:uploadCrashlyticsMappingFileApplicationQa'
18:58:53.417 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa'
18:58:53.417 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa' completed
18:58:53.417 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:uploadCrashlyticsMappingFileApplicationQa (Thread[Task worker for ':',5,main]) completed. Took 7.201 secs.
':': acquired lock on root.1.26
As you can see the process uploads the file and then completes, however in the ubuntu container it doesn't happen:
00:32:25.697 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:uploadCrashlyticsMappingFileApplicationQa (Thread[Task worker for ':' Thread 7,5,main]) started.
00:32:25.697 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
00:32:25.697 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:uploadCrashlyticsMappingFileApplicationQa FAILED
00:32:25.697 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa' started
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Putting task artifact state for task ':app:uploadCrashlyticsMappingFileApplicationQa' into context took 0.0 secs.
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':app:uploadCrashlyticsMappingFileApplicationQa' is up-to-date
00:32:25.697 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Task ':app:uploadCrashlyticsMappingFileApplicationQa' is not up-to-date because:
Task has not declared any outputs despite executing actions.
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':app:uploadCrashlyticsMappingFileApplicationQa'.
00:32:25.697 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa' started
00:32:25.701 [DEBUG] [com.google.firebase.crashlytics] Getting appId from output of the Google Services plugin at /codebuild/output/src160981101/src/Application/app/build/generated/res/google-services/Application/qa/values/values.xml
00:32:25.733 [DEBUG] [com.google.firebase.crashlytics] Found Google appId: 1:775166595613:android:604478ccade232432
00:32:25.741 [DEBUG] [com.google.firebase.crashlytics] Uploading Mapping File [mappingFile: /codebuild/output/src160981101/src/Application/app/build/outputs/mapping/Application/qa/mapping.txt; mappingFileId: 140f7e5865d146cdb1c49d4eae9d82b7;packageName: com.Application.android.qa; googleAppId: 1:775166595613:android:604478ccade232432]
00:32:25.742 [DEBUG] [com.google.firebase.crashlytics] Zipping mapping file: /codebuild/output/src160981101/src/Application/app/build/outputs/mapping/Application/qa/mapping.txt -> /codebuild/output/src160981101/src/Application/app/build/crashlytics/ApplicationQa/mappings/140f7e5865d146cdb1c49d4eae9d82b7.gz
00:32:25.742 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.742 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa' completed
00:32:25.743 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
00:32:25.743 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.743 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.743 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa' completed
00:32:25.743 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:uploadCrashlyticsMappingFileApplicationQa (Thread[Task worker for ':' Thread 7,5,main]) completed. Took 0.045 secs.
So I really don't know what if going on, but this is breaking the pipeline because is not compiling, if I set the flag on the Gradle file of mappingFileUploadEnabled to false:
mappingFileUploadEnabled false
the project is compiling successfully but, when it is set to true it is not.
So seems like the problem is firebase is not reaching its server but I don't know why, the container doesn't have any IP restriction to firebase
Thank you for your help I really appreciate it!
After several days of doing this, I discovered that the problem is related to Crashlytics and the Gradle version if you use this configuration:
Docker Image for building the project: standard/ubuntu4:0 from this place
Gradle version: 4.10.3 and android Gradle plugin 3.3.3
Any version of Crashlytics from 17.0.0 and up
Progurad must be enabled and the flag to upload the mapping file to Crashlycts must be true
Then run the project and the project will crash.
The solution is to upgrade the Gradle version to 5.1.1 and the project will run properly, a code example is here
You can see through the comments, how the project evolved.
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
I have my site which is using nginx, and testing site with header testing tools e.g. http://www.webconfs.com/http-header-check.php but every time it says 400 bad request below is the out put from the tool. Though all my pages load perfectly fine in browser and when I see in chrome console it says status code 200OK.
HTTP/1.1 400 Bad Request =>
Server => nginx
Date => Fri, 07 Sep 2012 09:40:09 GMT
Content-Type => text/html
Content-Length => 166
Connection => close
I really don't understand what is the problem with my server config?
A bit of googling suggests to increase the buffer size using, and I increased it to following:
large_client_header_buffers 4 16k;
The same results persist.
Can some one guide me to the right direction?
As stated by Maxim Dounin in the comments above:
When nginx returns 400 (Bad Request) it will log the reason into error
log, at "info" level. Hence an obvious way to find out what's going on
is to configure
error_log
to log messages at "info" level and take a look into error log when
testing.
Yes changing the error_to debug level as Emmanuel Joubaud suggested worked out (edit /etc/nginx/sites-enabled/default ):
error_log /var/log/nginx/error.log debug;
Then after restarting nginx I got in the error log with my Python application using uwsgi:
2017/02/08 22:32:24 [debug] 1322#1322: *1 connect to unix:///run/uwsgi/app/socket, fd:20 #2
2017/02/08 22:32:24 [debug] 1322#1322: *1 connected
2017/02/08 22:32:24 [debug] 1322#1322: *1 http upstream connect: 0
2017/02/08 22:32:24 [debug] 1322#1322: *1 posix_memalign: 0000560E1F25A2A0:128 #16
2017/02/08 22:32:24 [debug] 1322#1322: *1 http upstream send request
2017/02/08 22:32:24 [debug] 1322#1322: *1 http upstream send request body
2017/02/08 22:32:24 [debug] 1322#1322: *1 chain writer buf fl:0 s:454
2017/02/08 22:32:24 [debug] 1322#1322: *1 chain writer in: 0000560E1F2A0928
2017/02/08 22:32:24 [debug] 1322#1322: *1 writev: 454 of 454
2017/02/08 22:32:24 [debug] 1322#1322: *1 chain writer out: 0000000000000000
2017/02/08 22:32:24 [debug] 1322#1322: *1 event timer add: 20: 60000:1486593204249
2017/02/08 22:32:24 [debug] 1322#1322: *1 http finalize request: -4, "/?" a:1, c:2
2017/02/08 22:32:24 [debug] 1322#1322: *1 http request count:2 blk:0
2017/02/08 22:32:24 [debug] 1322#1322: *1 post event 0000560E1F2E5DE0
2017/02/08 22:32:24 [debug] 1322#1322: *1 post event 0000560E1F2E5E40
2017/02/08 22:32:24 [debug] 1322#1322: *1 delete posted event 0000560E1F2E5DE0
2017/02/08 22:32:24 [debug] 1322#1322: *1 http run request: "/?"
2017/02/08 22:32:24 [debug] 1322#1322: *1 http upstream check client, write event:1, "/"
2017/02/08 22:32:24 [debug] 1322#1322: *1 http upstream recv(): -1 (11: Resource temporarily unavailable)
Then I took a look to my uwsgi log and found out that:
Invalid HTTP_HOST header: 'www.mysite.local'. You may need to add u'www.mysite.local' to ALLOWED_HOSTS.
[pid: 10903|app: 0|req: 2/4] 192.168.221.2 () {38 vars in 450 bytes} [Wed Feb 8 22:32:24 2017] GET / => generated 54098 bytes in 55 msecs (HTTP/1.1 400) 4 headers in 135 bytes (1 switches on core 0)
And adding www.mysite.local to the settings.py ALLOWED_HOSTS fixed the
issue :)
ALLOWED_HOSTS = ['www.mysite.local']
I had the same issue and tried everything. This 400 happened for an upstream proxy.
Debug logged showed absolutely nothing.
The problem was in duplicate proxy_set_header Host $http_host directive, which I didn't notice initially.
Removing duplicate one solved the issue immediately.
I wish nginx was saying something other than 400 in this scenario, as nginx -t didn't complain at all.
P.S. this happened while migrating from older nginx 1.10 to the newer 1.19. Before it was tolerated apparently.
Just to clearify, in /etc/nginx/nginx.conf, you can put at the beginning of the file the line
error_log /var/log/nginx/error.log debug;
And then restart nginx:
sudo service nginx restart
That way you can detail what nginx is doing and why it is returning the status code 400.
A cause can be invalid encoding in the URL request. Such as % being passed un-encoded.
When nginx returns 400(bad request) it will log the reason into error log, at "info" level and take a look into error log when testing.
In my case, the issue was that port 443 wasn´t opened in the router
If you get log just like this:
client xx.xx.xx.xx closed keepalive connection
For this issue:"Connection: upgrade" causes 400 error that never reaches application code. Triggered by common nginx config. #17081
just set proxy_set_header Connection $http_connection
normally, Maxim Donnie's method can find the reason. But I encountered one 400 bad request will not log to err_log. I found the reason with the help with tcpdump