Firebase hosting deployment failing - reactjs

Running firebase deploy will run for a few minutes before giving me a timeout error Error: ESOCKETTIMEDOUT
I've successfully deployed multiple times earlier, without changing anything but the frontend of my project (written in React).
I have a separate folder with my cloud functions, which deploy perfectly with firebase deploy --only functions
I've tried regular deployment with firebase deploy as well as with --except functions flag but with no luck.
Also tried updating npm and firebase-tools
running firebase deploy --debug yields the following error after a few minutes:
[2019-09-12T16:25:59.115Z] FirebaseError: Task 6822eef99ebcce0df4baf9cc03e49b399d046c7cdfeb5b2a2ef2511c1df963d1 failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.115Z] [hosting][upload queue][FINAL] max=7278, min=7278, avg=7278, active=4, complete=2, success=1, errored=1, retried=25, total=6, elapsed=192701
[2019-09-12T16:25:59.127Z] FirebaseError: Task f98dce8e7830e8cd5881bc5e109453c208ff7fc643d61ad64ca34a7d098abc2c failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.127Z] FirebaseError: Task 5a7166c6cab1624c8a0c074fc535a23685c338be838012dced4006be3cc6dedd failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.128Z] FirebaseError: Task 76dd5b5551e5cd383875692455ff415bf8df56c97f67e4a3746e3c53c23478e1 failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.129Z] FirebaseError: Task 541bb1a8843dd0c62ea7e673f2260c85e0b456f35cfde358b6ab3be936e9c705 failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.211Z] Error: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:816:19)
at Object.onceWrapper (events.js:298:28)
at ClientRequest.emit (events.js:209:13)
at ClientRequest.EventEmitter.emit (domain.js:476:20)
at TLSSocket.emitRequestTimeout (_http_client.js:690:9)
at Object.onceWrapper (events.js:298:28)
at TLSSocket.emit (events.js:209:13)
at TLSSocket.EventEmitter.emit (domain.js:476:20)
at TLSSocket.Socket._onTimeout (net.js:468:8)
at listOnTimeout (internal/timers.js:531:17)
Error: Task 6822eef99ebcce0df4baf9cc03e49b399d046c7cdfeb5b2a2ef2511c1df963d1 failed: retries exhausted after 6 attempts

Delete the hidden folder in you project root directory.
.firebase/hosting.*.cache

Deleting the .firebase folder and tried firebase deploy command again. Things seemed to be working fine.

As #thmsdnnr mentioned, it seems that this error was caused by issues at firebase. Tried a new deployment first thing in the morning and everything went through first try.

There are two reasons to happen this.
by deleting .firebase folder in your root folder will solve problem.
if this dosen't work,
your internet connection may slow and size of files in your project may be bigger. so try with fast internet connection.
with slow internet, if you try deploying again and again, you will see that number of files uploading decreases on console. that means your files are getting uploaded, but it taking too much time, and firebase is getting exhausted.

as explained already by #thmsdnnr, it is indeed a firebase issue, but can be due to some issues at your end as well.
For example, for me it was the slow internet connection responsible for it.
Besides, you can always delete the ".firebase" folder, and re-build your project for starting afresh with hosting.

I also faced an issue like that
Error: Task 91525507ddf6d644ed40f9c46c3e30a2164f496acb1328512d4cf5eaf8d18768 failed: retries exhausted after 6 attempts
PS D:\React\amazon-clone> firebase deploy
But I fixed it. Put this change in your firebase.json file:
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
to
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
and it will work fine.

I was struggling with this problem too. After trying many methods, I solved the deployment issue as follows;
At first, I deleted node modules and reinstalled it again. I deleted firebase files (.firebase, firebase.json)
Then I applied them;
Update Firebase CLI via "npm i -g firebase-tools"
Log in to your account via "firebase login",
Initialize the project via "firebase init hosting"
And lastly deploy it via "firebase deploy --only hosting"
I was able to deploy my project on firebase with these steps. I hope someone else's problem is solved this way.
I recommend you to check here for detailed information.

As mentioned in the error massage: Timeout reached making request to https://url_path.
I found the same problem, the mine relates to the network.
So check your network connection.

Related

Error Debugging in VS Code: Cannot connect to the target at localhost:3000: could not find any debuggable target

I have an application with React on frontend and .Net Core on backend and i am trying to debug my react frontend, without extensions and attaching to the process, but i am getting the message error bellow:
Cannot connect to the target at localhost:3000: Could not connect to debug target at http:localhost:3000: Could not find any debuggable target.
I'm using this launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug FrontEnd",
"port": 3000,
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}"
},
{
"name": "Debug BackEnd",
"type": "coreclr",
"request": "attach"
}
]
}
I start my frontend using npm start witch is basically react-scripts start.
Obs.: Iḿ using opera browser.
I found a workaround.
This problem only occurs when I run with sudo npm start.
When running it with just npm start I got this message:
"Unhandled exception. System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached."
So I solved it increasing the fs.inotify.max_user_instances with this command:
echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
I found this solution by the answer of #Creak . To see more details, click this link
After a search, all I could found was this issue.
Although Opera is now based on Chromium, it's not possible to debug it using VSCode yet. Maybe someone can come with a kind of workaround for it.

AppEngine Deploy is Conflicting SHA1 sum for a file

I want to deploy an update to our app but we have an issue with gcloud command which failed to "Conflicting SHA1 sum for file". Here is the output:
➜ gcloud app deploy xxx-xxx-xxxx.yaml --project xxx-xxx-xxxx --quiet
Services to deploy:
descriptor: [/home/vzool/Workspace/xxx-xxxx-xxxxxxxxxxx/xxx-xxx-xxxx.yaml]
source: [/home/vzool/Workspace/xxx-xxxx-xxxxxxxxxxx]
target project: [xxx-xxx-xxxx]
target service: [default]
target version: [20180917t110153]
target url: [https://xxx-xxx-xxxx.appspot.com]
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1 file to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [3] The following errors occurred while copying files to App Engine:
File https://storage.googleapis.com/staging.xxx-xxx-xxxx.appspot.com/c819d7599ceb31df8d4370eed1981defcb5034c6 failed with: Conflicting SHA1 sum for file. Expected "ddb6af3b_cf4bff57_613fb78d_208480fa_1717b3c4" but received "c819d759_9ceb31df_8d4370ee_d1981def_cb5034c6".
Details: [
[
{
"#type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Conflicting SHA1 sum for file. Expected \"ddb6af3b_cf4bff57_613fb78d_208480fa_1717b3c4\" but received \"c819d759_9ceb31df_8d4370ee_d1981def_cb5034c6\".",
"resourceName": "https://storage.googleapis.com/staging.xxx-xxx-xxxx.appspot.com/c819d7599ceb31df8d4370eed1981defcb5034c6",
"resourceType": "file"
}
]
]
I do delete this file c819d7599ceb31df8d4370eed1981defcb5034c6 but everytime new hash will be generated, delete entire block staging.xxx-xxx-xxxx.appspot.com and I did clear Memcache but with no luck trying all these options! :(
I don't know what to do anymore with this, any suggestions may help me out?
Thanks
I think after sometime in research the issue, the app itself has a live feature which lead to update one file while you open live page.
So, that change what gcloud uploaded.
gcloud upload then verify. And if file changed after upload and before verify gcloud will through this error on your face. Ha ha ha ^_^
OP's answer seemed to indicate that a file got touched during the gcloud deploy process.
The solution for me was to:
git checkout some random branch
git checkout the branch I was actually trying to deploy again
run gcloud app deploy . --version my_version_id --project my_project_id

AppEngine App Deploy gives "Failed to copy file."

I'm deploying a Laravel app to a fresh App Engine project. But I'm getting this error constantly. I tried creating a new project and deploying too.
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 9625 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [3] Errors were encountered while copying files to App Engine.
Details: [
[
{
"#type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Failed to copy file.",
"resourceName": "https://storage.googleapis.com/staging.rsvp.appspot.com/df4bc71e8832337e997291648609c4e207b5aa55",
"resourceType": "file"
}
]
]
WHat is the problem here and how can I fix it?
The reason for this issue was, I had some large size files ( > 30Mb ) in my project folder. I removed them and redeployed, it worked without an issue.
As OP already mentioned, the reason is large files. Here is how you can also find out which file is causing the problem.
If you have an error such as
Details: [
[
{
"#type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Failed to copy file.",
"resourceName": "https://storage.googleapis.com/staging.bemmu1-hrd.appspot.com/b463c152ee1498bd4d27c1ea67c7f8e82cb4b220",
"resourceType": "file"
}
]
]
Note the hash that appears in resourceName, in this case "b463c152ee1498bd4d27c1ea67c7f8e82cb4b220".
Search for it in the most recent log file (mine was /Users/bemmu/.config/gcloud/logs/2019.07.30/00.45.43.657001.log) and you'll find it as part of a really long string, in my case:
...'templates/envato/images/arrangement.png': {'sourceUrl': 'https://storage.googleapis.com/staging.bemmu1-hrd.appspot.com/b463c152ee1498bd4d27c1ea67c7f8e82cb4b220'...
From this I could see that in my case the offending file was arrangement.png

Setting up Protractor to automatically open and close Selenium

I'm trying to set up E2E testing on one of my windows asp.net (mvc->angular)projects.
We use team city to do our builds so I want my configuration to work on my box and on the build box.
I'm stuck trying to set up the values in conf.js so that protractor will automatically start up and stop when protractor needs it...
I run it via a batch file like this:
call npm install -g
call C:\Users\brown.ericw\AppData\Roaming\npm\protractor conf.js
pause
Everything was working fine when I was running selenium manually.
But I just can't figure out the right conf.js to get selenium started and shut down automatically(Stopping it in the bat file was not always effective, despite several different approaches).
I've tried lots of different combos, but I'm stumped.
Here is the relevant portion of my conf.js:
exports.config = {
seleniumjar: '.\node_modules\protractor\selenium\selenium-server-standalone-2.45.0.jar',
//seleniumArgs: '-Dwebdriver.chrome.driver="\node_modules\protractor\selenium\chromedriver',
//chromeDriver: '.\node_modules\protractor\selenium\chromedriver',
//chromeDriver: '.\node_modules\protractor\bin\webdriver-manager',
chromeDriver: 'C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver',
//seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'e2eTests/*.js'
],
I have protractor installed under my project folder, so I run npm install, so I know it's all kosher at the beginning of the run on the build/test server.
Here is the error I'm getting.. Clearly I can't I figure out the setting to get get it pointing towards the chrome driver...
D:\TFS\TACAdmin3G_Test_E2E>call
C:\Users\brown.ericw\AppData\Roaming\npm\protra ctor conf.js
[launcher] Process exited with error code 1
C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\node_modules\q\
q.js:126
throw e;
^ Error: Could not find chromedriver at D:\TFS\TACAdmin3G\node_modules\protractor\ selenium\chromedriver
at LocalDriverProvider.addDefaultBinaryLocs_ (C:\Users\Brown.ericw\AppData\R
oaming\npm\node_modules\protractor\lib\driverProviders\local.js:54:15)
at LocalDriverProvider.setupEnv (C:\Users\Brown.ericw\AppData\Roaming\npm\no
de_modules\protractor\lib\driverProviders\local.js:71:8)
at Runner.run (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protrac
tor\lib\runner.js:265:31)
at TaskRunner.run (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\pro
tractor\lib\taskRunner.js:123:19)
at createNextTaskRunner (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modul
es\protractor\lib\launcher.js:220:20)
at C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\lib\laun
cher.js:243:7
at _fulfilled (C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protrac
tor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\Brown.ericw\AppData\Roaming\npm\node_
modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\Users\Brown.ericw\AppData\Roaming\npm
\node_modules\protractor\node_modules\q\q.js:759:13)
at C:\Users\Brown.ericw\AppData\Roaming\npm\node_modules\protractor\node_mod
ules\q\q.js:573:44
I tried changing the slashes because of the space in the path up there and it changed back to the normal path:
Error: Could not find chromedriver at D:\TFS\TACAdmin3G\_Test_E2E\..
which doesn't give me the whole path.
chromedriver.exe is in all the locations in the various commented version in the conf.js. but no joy truing each of them.
I need to use relative pathing because the root folder on my box is different than the one on the build server.
Any help is greatly appreciated.
Forgot to say I looked at this one:Protractor does not find chromedriver: The driver executable does not exist:
and this one
how to close selenium webdriver at end of test?
and wasn't able to figure it out
Okay every body, for those who follow ,here is the answer to the problem and why I think this is what works. This answer works in my node.js project in VS(have to add the packages here too) , in a batch file on my dev box, and in team city.
I added NPM INSTALL to my build script, so that once the code is pulled down it immediately puts all the js packages in the code directories.
Then I added the selenium server stand lone package to my project(and package.json so I knew exactly where the jar is. I added it as a --Save(write to config)and as a --Dev (add in the dev section, ie include in node_models in my code folders)
Then I have this in my conf.js
> exports.config = {
> seleniumServerJar: 'node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-2.45.0.jar',
> chromeDriver: './node_modules/protractor/selenium/chromedriver',
> //seleniumAddress: 'http://localhost:4444/wd/hub',
There are several subtle but important changes.
1
seleniumServerJar vs seleniumjar - there are a lot of examples out there using seleniumjar... so I'm guessing the standard tag changed at some point, but seleniumServerJar is what is shown on the documentation pages and it's what works.
2
/ vs \ as the slash in paths.. this one was tricks because when I used backslash, it didn't complain, the only difference was it truncated the path with a ... in the error messages, but when i dug in deeper, backslashes are getting removed from the part of the path you enter... even the part the code uses based on .\ has back slashes... so only use forward slashes in paths in these tags in conf.js
3
Relative pathing with ../node_modules vs .\node_modules vs node_modules..., there are examples out there with all of these used, once I was able to see the full paths being generated I figured out that ../ wasn't what I wanted.. so I played with it and got it working with one ./ and one nothing... why they both didn't work with ./ I don't know.. but it works.(sorry about that)
Just in case it helps you here is my package.json
{
"name": "_Test_e2e",
"version": "0.0.0",
"description": "_Test_e2e",
"main": "app.js",
"author": {
"name": "Brown.EricW",
"email": ""
},
"devDependencies": {
"jasmine-reporters": "^1.0.0",
"protractor": ">=0.14.0-0 <1.0.0",
"selenium-server-standalone-jar": "^2.45.0"
},
"scripts": {
"postinstall": "webdriver-manager update"
},
"dependencies": {
"jasmine": "^2.3.1",
"jasmine-reporters": "^1.0.0",
"protractor": "^2.1.0"
}
}
Running real browsers on build server probably isn't a good solution. If you have a dedicated Teamcity node, then a headless browser implementation like PhantomJS could be an option. You need to make sure that PhantomJS is installed on your dedicated node and its executable is placed somewhere in the PATH. Also make sure to set browser name to be phantomjs instead of chrome.
Secondly you could setup a Selenium grid and setup nodes with different browsers you want to test. From build server you would run tests on the remote selenium grid on the browser of your choice. There are paid, third part options like sauce labs or browser stack if you wish to go that route.
I would tend to go with second option since PhantomJS is not a real browser and you may have requirement of testing your application on different browsers/platforms etc.

Exclude Thumbs.db from Sencha Cmd build

When executing "sencha app build production", I receive the following error message:
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: Cannot find file : C:\apache24\htdoc
s\extjs\myapp\build\production\myapp\resources\images\Thumbs.db (Access denied)
I know that the answer could be "use a system tool to close the file handle". But I am tired of doing so, and since the Thumbs.db files are useless, I'd like to exclude copying them from the build process - once and for all times.
I tried via app.json, where I found an exclude for svn files:
"resources": [
"resources/images"
],
"ignore": [
"\.svn$",
"\.db$"
],
but that didn't yield the expected result. Any ideas?

Resources