electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.69k stars 1.74k forks source link

part download request failed with status code 416 #3115

Open vankop opened 6 years ago

vankop commented 6 years ago

20.20.4

node 8.9.1

npm 5.6.0

package.json

{
  "name": "emp-admin-developer-app",
  "version": "1.3.0",
  "private": true,
  "main": "build/electron/index.js",
  "devDependencies": {
    "antd": "^3.6.3",
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.3",
    "babel-eslint": "^8.2.3",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
    "concurrently": "^3.6.0",
    "copyfiles": "^1.2.0",
    "electron": "^2.0.4",
    "electron-builder": "^20.20.4",
    "react-scripts": "1.1.0",
    "redux-form": "^7.4.2",
    "require-context": "=1.0.4",
    "wait-on": "^2.1.0"
  },
  "dependencies": {
    "ajv": "^6.5.1",
    "ajv-i18n": "^3.3.0",
    "electron-is-dev": "^0.3.0",
    "emp-admin-entity-administration-config-app": "^0.8.3",
    "emp-admin-icons": "^1.4.0",
    "jsoneditor-react": "^0.1.9",
    "open": "0.0.5",
    "react": "^16.4.1",
    "react-dom": "^16.4.1",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.3.1",
    "redux": "^3.7.2"
  },
  "scripts": {
    "dev": "react-scripts start",
    "build:app": "react-scripts build",
    "build:electron": "node buildElectron.js",
    "build": "npm run build:app && npm run build:electron",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "electron": "npm run build:electron && electron .",
    "electron-dev": "concurrently \"npm run dev\" \"wait-on http://localhost:3000 && npm run electron\"",
    "electron-pack:win": "electron-builder -w -c electron-builder.json",
    "electron-pack:linux": "electron-builder -l -c electron-builder.json",
    "electron-pack": "electron-builder -c electron-builder.json",
    "preelectron-pack": "rimraf \"dist\" && npm run build",
    "preelectron-pack:win": "npm run preelectron-pack",
    "preelectron-pack:linux": "npm run preelectron-pack"
  }
}

electron-builder.json

{
  "appId": "ru.altarix.admin.emp",
  "files": [
    "build/**/*",
    "node_modules/**/*"
  ],
  "directories":{
    "buildResources": "assets"
  },
  "win": {
    "target": "nsis",
    "icon": "assets/icons/png/256x256.png"
  },
  "linux": {
    "target": [
      "deb",
      "AppImage"
    ],
    "icon": "assets/icons/png/256x256.png"
  }
}

Can not download builded remotely deb package. Complete console log:

> emp-admin-developer-app@1.3.0 electron-pack:linux C:\Users\kopeykinia\Repositories\emp-admin-developer-app
> electron-builder -l -c electron-builder.json

  • electron-builder version=20.20.4
  • loaded configuration file=C:\Users\kopeykinia\Repositories\emp-admin-developer-app\electron-builder.json
  • loaded parent configuration preset=react-cra
  • writing effective config file=dist\electron-builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=linux arch=x64 electron=2.0.4 appOutDir=dist\linux-unpacked
  • scheduling remote build target=deb arch=x64
  • scheduling remote build target=appImage arch=x64
  • compressing and uploading to remote builder
  • uploaded to remote builder duration=2m47.87s
  • remote building           status=job started (queue time: 2ms)
  • remote building           status=  • electron-builder version=20.20.0
  • building        target=AppImage arch=x64 file=out/emp-admin-developer-app-1.3.0-x86_64.AppImage
  • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
  • building        target=deb arch=x64 file=out/emp-admin-developer-app_1.3.0_amd64.deb
  • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category

  ⨯ part download request failed with status code 416
github.com/develar/app-builder/pkg/download.(*Part).doRequest
        /Users/develar/go/src/github.com/develar/app-builder/pkg/download/Part.go:127
github.com/develar/app-builder/pkg/download.(*Part).download
        /Users/develar/go/src/github.com/develar/app-builder/pkg/download/Part.go:46
github.com/develar/app-builder/pkg/download.(*Downloader).DownloadResolved.func1.1
        /Users/develar/go/src/github.com/develar/app-builder/pkg/download/downloader.go:96
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func1
        /Users/develar/go/src/github.com/develar/app-builder/pkg/util/async.go:56
runtime.goexit
        /usr/local/Cellar/go/1.10.3/libexec/src/runtime/asm_amd64.s:2361

Error: C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code 1
    at ChildProcess.childProcess.once.code (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\builder-util\src\util.ts:251:14)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
From previous event:
    at RemoteBuilder._build (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\remoteBuilder\RemoteBuilder.ts:56:83)
    at _bluebirdLst.default.mapSeries.arch (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\remoteBuilder\RemoteBuilder.ts:51:19)
From previous event:
    at RemoteBuilder.build (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\remoteBuilder\RemoteBuilder.ts:50:28)
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\linuxPackager.ts:99:30
From previous event:
    at RemoteTarget.finishBuild (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\linuxPackager.ts:97:20)
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\packager.ts:377:36
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Packager.doBuild (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\packager.ts:337:39)
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\packager.ts:313:52
    at Generator.next (<anonymous>)
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\graceful-fs\graceful-fs.js:99:16
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\graceful-fs\graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at Packager._build (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\packager.ts:290:133)
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\packager.ts:286:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Packager.build (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\packager.ts:243:14)
    at C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\src\index.ts:52:40
    at Generator.next (<anonymous>)
From previous event:
    at build (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder-lib\out\index.js:220:17)
    at build (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder\src\builder.ts:224:10)
    at then (C:\Users\kopeykinia\Repositories\emp-admin-developer-app\node_modules\electron-builder\src\cli\cli.ts:42:48)
    at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! emp-admin-developer-app@1.3.0 electron-pack:linux: `electron-builder -l -c electron-builder.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the emp-admin-developer-app@1.3.0 electron-pack:linux script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kopeykinia\AppData\Roaming\npm-cache\_logs\2018-07-13T10_20_22_736Z-debug.log
wwtj commented 6 years ago

Have you solved your problem?I have the same problem now

develar commented 6 years ago

@wwtj interesting... do you have slow download speed?

wwtj commented 6 years ago

thank you, and I didn't do that. how could that be?

develar commented 6 years ago

Do you still have this error? Contact me via Slack if you want.

wwtj commented 6 years ago

I'm very sorry for the late reply. In fact, I don't know how to communicate with Slack. My gamail is wangtianjiao9@gmail.com. Can you contact me first?Thank you very much.

develar commented 6 years ago

@wwtj I suspect that problem is that your internet connection is not fast or app is too big, and during download your master connection to remote build server is closed because of inactivity (yes, we need to send PING message, need to check).

Is error reproducible every time?

Contact me via Slack if you want.

... to see building in a realtime (inspecting server logs), but right now I don't have time.

wwtj commented 6 years ago

Thanks for your help. The mistake disappeared and I didn't do anything.

KacyLuzz commented 6 years ago

I don't have a slow connection (180 Mbps in download, 15 Mbps upload) and my app is around ~150 Mo. So, is it really a client-side problem ?

brandonbothell commented 6 years ago

The same thing happens to me.

amanharwara commented 5 years ago

I got the same issue except the status code is 403. It's the first time it happened to me and it only happens when trying to build for macOS. It downloaded just fine on Linux and Windows. My electron-builder version is v21.2.0 and the electron version is v7.1.0

Edit: Tried it again today and it worked.

digaus commented 4 years ago

Also getting 403:


• downloading     url=https://github.com/electron/electron/releases/download/v7.1.7/electron-v7.1.7-win32-x64.zip size=63 MB parts=8                                                                                                    ize=63 MB parts=8
  • retrying        attempt=1
  • retrying        attempt=2
  • retrying        attempt=3
  ⨯ part download request failed with status code 403
github.com/develar/app-builder/pkg/download.(*Part).doRequest
        /Volumes/data/Documents/app-builder/pkg/download/Part.go:126
github.com/develar/app-builder/pkg/download.(*Part).download
        /Volumes/data/Documents/app-builder/pkg/download/Part.go:67
github.com/develar/app-builder/pkg/download.(*Downloader).DownloadResolved.func1.1
        /Volumes/data/Documents/app-builder/pkg/download/downloader.go:107
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2
        /Volumes/data/Documents/app-builder/pkg/util/async.go:68
runtime.goexit
        /usr/local/Cellar/go/1.12.7/libexec/src/runtime/asm_amd64.s:1337  
  ⨯ C:\Projekte\ShellyHomeCapacitor\electron\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
vsvipul commented 4 years ago

Same is happening for me as well.

phipag commented 4 years ago

I get 403 as well for mac os.

emagombe commented 4 years ago

I'm getting 403 for windows!!! And one suggestion is that you could add a progress bar for the download progress!!!

bitterdev commented 4 years ago

same here 403 on Mac OS

bitterdev commented 4 years ago

Any progress? Or workaround? Another stable release? It's a real blocker and it seems that the owner/support-team does not response to this issue since many days?

digaus commented 4 years ago

Any progress? Or workaround? Another stable release? It's a real blocker and it seems that the owner/support-team does not response to this issue since many days?

I just restarted a few times and then it worked

bitterdev commented 4 years ago

I restarted it 20 times at least. Not solving the issue. Is there a possibility to install it manually? Im able to download the file from Webbrowser.

Gesendet von ProtonMail mobile

-------- Original-Nachricht -------- An 15. Jan. 2020, 14:02, digaus schrieb:

Any progress? Or workaround? Another stable release? It's a real blocker and it seems that the owner/support-team does not response to this issue since many days?

I just restarted a few times and then it worked

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

muhsin-k commented 4 years ago

Any update on this issue ?

phipag commented 4 years ago

I tried it in a faster network and then it worked. Seems that slow internet connections result in a 403. It seems that this is a problem of the aws server of github releases https://github.com/cavaliercoder/grab/issues/43

bitterdev commented 4 years ago

I can confirm that. I have connected through LTE with 100mbit/s and now it's working.

chris-envas commented 4 years ago

I have this difficulty ,I get 403 in win7

• electron-builder version=22.3.2 os=6.1.7601 • loaded configuration file=package.json ("build" field) • writing effective config file=dist\builder-effective-config.yaml • packaging platform=win32 arch=x64 electron=7.1.9 appOutDir=dist\win-unpacked • downloading url=https://github.com/electron/electron/releases/download/v7.1.9/electron-v7.1.9-win32-x64.zip size=63 MB parts=8 • retrying attempt=1 • retrying attempt=2 • retrying attempt=3 ⨯ part download request failed with status code 403 github.com/develar/app-builder/pkg/download.(Part).doRequest /Volumes/data/Documents/app-builder/pkg/download/Part.go:126 github.com/develar/app-builder/pkg/download.(Part).download /Volumes/data/Documents/app-builder/pkg/download/Part.go:67 github.com/develar/app-builder/pkg/download.(*Downloader).DownloadResolved.func1.1 /Volumes/data/Documents/app-builder/pkg/download/downloader.go:107 github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2 /Volumes/data/Documents/app-builder/pkg/util/async.go:68 runtime.goexit /usr/local/Cellar/go/1.13.6/libexec/src/runtime/asm_amd64.s:1357 ⨯ C:\Users\Administrator\Desktop\cloud-electron-docs\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILD ER_CANNOT_EXECUTE stackTrace=

emagombe commented 4 years ago

It seems it needs a fast insternet conection!!!!

Whe you download from https://github.com/electron/electron/releases/download/v7.1.9/electron-v7.1.9-win32-x64.zip

it is redirected to https://github-production-release-asset-2e65be.s3.amazonaws.com/9384267/4b4b4700-35ec-11ea-85f9-a6f2044a75fb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200217%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200217T071158Z&X-Amz-Expires=300&X-Amz-Signature=5644d81633e633c7b118b1062c2f12822ddb133e540de2ac043be37d7360808d&X-Amz-SignedHeaders=host&actor_id=33861085&response-content-disposition=attachment%3B%20filename%3Delectron-v7.1.9-win32-x64.zip&response-content-type=application%2Foctet-stream

That is temporary. as you can see here: https://github-production-release-asset-2e65be.s3.amazonaws.com/9384267/4b4b4700-35ec-11ea-85f9-a6f2044a75fb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200217%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200217T071158Z& X-Amz-Expires=300 &X-Amz-Signature=5644d81633e633c7b118b1062c2f12822ddb133e540de2ac043be37d7360808d&X-Amz-SignedHeaders=host&actor_id=33861085&response-content-disposition=attachment%3B%20filename%3Delectron-v7.1.9-win32-x64.zip&response-content-type=application%2Foctet-stream

In this parameter: X-Amz-Expires=300

And when it expires the file cannot be downloaded anymore!!!

naycho334 commented 4 years ago

Just download the file manually and move it to this path:

C:\Users{USER}\AppData\Local\electron\Cache

futantan commented 4 years ago

https://www.electronjs.org/docs/tutorial/installation#cache I download it by myself and put it in the cache folder to fix this.

omartadj commented 4 years ago

Disabling real-time protection in my anti virus fixed it for me. Remember to enable it again when the build process is complete

Onat-T commented 4 years ago

Hi everyone. Temporarily disabling real-time protection in my antivirus software fixed my issue too. I initially had a 403 error on Windows. Good luck!

chris-envas commented 4 years ago

Okay!

------------------ 原始邮件 ------------------ 发件人: "Mahogany95"<notifications@github.com>; 发送时间: 2020年5月2日(星期六) 凌晨2:02 收件人: "electron-userland/electron-builder"<electron-builder@noreply.github.com>; 抄送: "阳光"<382967255@qq.com>; "Comment"<comment@noreply.github.com>; 主题: Re: [electron-userland/electron-builder] part download request failed with status code 416 (#3115)

Hi everyone. Temporarily disabling real-time protection in my antivirus software fixed my issue too. I initially had a 403 error on Windows. Good luck!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

salimdriai commented 3 years ago

any updates ?

jexroid commented 1 year ago

downloading manually worked for me

Just download the file manually and move it to this path:

C:\Users{USER}\AppData\Local\electron\Cache

thanks @naycho334