Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File write stream does not error when writing to a file in a non-existent bucket #436

Closed
theacodes opened this issue Mar 10, 2015 · 3 comments · Fixed by #438
Closed

File write stream does not error when writing to a file in a non-existent bucket #436

theacodes opened this issue Mar 10, 2015 · 3 comments · Fixed by #438
Assignees
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@theacodes
Copy link

When using file.createWriteStream when the file was created on a non-existent bucket, the stream does not error and essentially acts as if everything is fine. The only indication of error is the fact that no file is uploaded.

In the example below, one would expect the error event to trigger:

var gcloud = require('gcloud');

var storage = gcloud.storage({
  keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS,
  projectId: process.env.GCLOUD_PROJECT_ID
})

var bucket = storage.bucket('this-bucket-does-not-exist');

var file = bucket.file('file.ext');
var stream = file.createWriteStream();

stream.on('error', function(){ console.log('Error'); });
stream.on('finish', function(){ console.log('Done'); });

stream.write('data');
stream.end();
@ryanseys ryanseys added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: storage Issues related to the Cloud Storage API. labels Mar 10, 2015
@ryanseys ryanseys added this to the Storage Stable milestone Mar 10, 2015
@ryanseys
Copy link
Contributor

This is caused by handleError being used for all the things and the error is a 404 (bucket not found), which no amount of startUpload will solve.

@ryanseys
Copy link
Contributor

@jonparrott Also you should use the complete event rather than the finish event. :) We have a bug opened at #435 to address this as well.

@theacodes
Copy link
Author

Great, I'll switch over to the complete event. Will keep a lookout for the merged PR.

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
chingor13 pushed a commit that referenced this issue Aug 22, 2022
* feat: added support OSInventory in Assets. docs: updated existing docs.

Clients receive detailed OSInventory in Assets.

PiperOrigin-RevId: 342689216

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Nov 16 12:04:29 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb
Source-Link: googleapis/googleapis@1f8a514

* fix: better fallback feature detection, jsdoc update

Use gapic-generator-typescript v1.2.2.

PiperOrigin-RevId: 342778480

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Nov 16 20:22:00 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: c6b1c72942991b1c605fe56a6041e06a86a9443e
Source-Link: googleapis/googleapis@c6b1c72

* fix: linting, updated jsdoc blocks

Use gapic-generator-typescript v1.2.3.

PiperOrigin-RevId: 342976840

Source-Author: Google APIs <[email protected]>
Source-Date: Tue Nov 17 17:04:11 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: c979fbeb80d1b940790a69183629d799e4c05b4c
Source-Link: googleapis/googleapis@c979fbe

* fix: use optional chaining for window.fetch feature detection

Use gapic-generator-typescript v1.2.4.
Committer: @alexander-fenster
PiperOrigin-RevId: 343136730

Source-Author: Google APIs <[email protected]>
Source-Date: Wed Nov 18 12:49:25 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 2cda8d285b66c14da57363201b7e4efbca47d034
Source-Link: googleapis/googleapis@2cda8d2

* fix: mark window as global for linter

Use gapic-generator-typescript v1.2.5.
Committer: @alexander-fenster
PiperOrigin-RevId: 343187793

Source-Author: Google APIs <[email protected]>
Source-Date: Wed Nov 18 17:10:02 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 5587028631d4d743fd906c4eb4e4e4649a7ee5ce
Source-Link: googleapis/googleapis@5587028

* build: use gapic-generator-typescript v1.2.6

Committer: @alexander-fenster
PiperOrigin-RevId: 343202295

Source-Author: Google APIs <[email protected]>
Source-Date: Wed Nov 18 18:55:28 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 2f019bf70bfe06f1e2af1b04011b0a2405190e43
Source-Link: googleapis/googleapis@2f019bf

* build: include osconfig v1 protos into asset v1 Node.js package.

PiperOrigin-RevId: 344904496

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Nov 30 15:48:16 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: a578b42319ca0e3c7b6fec600a4ee9ec57443598
Source-Link: googleapis/googleapis@a578b42
chingor13 pushed a commit that referenced this issue Aug 22, 2022
sofisl pushed a commit that referenced this issue Oct 12, 2022
Fixes #421

chore: fix api_shortname
sofisl pushed a commit that referenced this issue Oct 12, 2022
sofisl pushed a commit that referenced this issue Nov 10, 2022
PiperOrigin-RevId: 325528080

Source-Author: Google APIs <[email protected]>
Source-Date: Fri Aug 7 16:11:33 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 9b0c7b1a4665909bd18a0e0fd33004945b5c9c13
Source-Link: googleapis/googleapis@9b0c7b1
sofisl pushed a commit that referenced this issue Nov 10, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) |

---

### Release Notes

<details>
<summary>TypeStrong/ts-loader</summary>

### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800)

[Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0)

-   [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@&#8203;sheetalkamat](https://togithub.com/sheetalkamat)!
-   `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**

</details>

---

### Renovate configuration

:date: **Schedule**: "after 9am and before 3pm" (UTC).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-tasks).
sofisl pushed a commit that referenced this issue Nov 11, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.41.2` -> `^5.0.0`](https://renovatebot.com/diffs/npm/webpack/4.44.2/5.1.0) |

---

### Release Notes

<details>
<summary>webpack/webpack</summary>

### [`v5.1.0`](https://togithub.com/webpack/webpack/releases/v5.1.0)

[Compare Source](https://togithub.com/webpack/webpack/compare/v5.0.0...v5.1.0)

### Features

-   expose `webpack` property from `Compiler`
-   expose `cleverMerge`, `EntryOptionPlugin`, `DynamicEntryPlugin`

### Bugfixes

-   missing `require("..").xxx` in try-catch produces a warning instead of an error now
-   handle reexports in concatenated modules correctly when they are side-effect-free
-   fix incorrect deprecation message for ModuleTemplate.hooks.hash

### [`v5.0.0`](https://togithub.com/webpack/webpack/releases/v5.0.0)

[Compare Source](https://togithub.com/webpack/webpack/compare/v4.44.2...v5.0.0)

[Announcement and changelog](https://webpack.js.org/blog/2020-10-10-webpack-5-release/)

</details>

---

### Renovate configuration

:date: **Schedule**: "after 9am and before 3pm" (UTC).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-dataproc).
sofisl pushed a commit that referenced this issue Nov 11, 2022
sofisl pushed a commit that referenced this issue Nov 11, 2022
* feat: added support OSInventory in Assets. docs: updated existing docs.

Clients receive detailed OSInventory in Assets.

PiperOrigin-RevId: 342689216

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Nov 16 12:04:29 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb
Source-Link: googleapis/googleapis@1f8a514

* fix: better fallback feature detection, jsdoc update

Use gapic-generator-typescript v1.2.2.

PiperOrigin-RevId: 342778480

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Nov 16 20:22:00 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: c6b1c72942991b1c605fe56a6041e06a86a9443e
Source-Link: googleapis/googleapis@c6b1c72

* fix: linting, updated jsdoc blocks

Use gapic-generator-typescript v1.2.3.

PiperOrigin-RevId: 342976840

Source-Author: Google APIs <[email protected]>
Source-Date: Tue Nov 17 17:04:11 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: c979fbeb80d1b940790a69183629d799e4c05b4c
Source-Link: googleapis/googleapis@c979fbe

* fix: use optional chaining for window.fetch feature detection

Use gapic-generator-typescript v1.2.4.
Committer: @alexander-fenster
PiperOrigin-RevId: 343136730

Source-Author: Google APIs <[email protected]>
Source-Date: Wed Nov 18 12:49:25 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 2cda8d285b66c14da57363201b7e4efbca47d034
Source-Link: googleapis/googleapis@2cda8d2

* fix: mark window as global for linter

Use gapic-generator-typescript v1.2.5.
Committer: @alexander-fenster
PiperOrigin-RevId: 343187793

Source-Author: Google APIs <[email protected]>
Source-Date: Wed Nov 18 17:10:02 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 5587028631d4d743fd906c4eb4e4e4649a7ee5ce
Source-Link: googleapis/googleapis@5587028

* build: use gapic-generator-typescript v1.2.6

Committer: @alexander-fenster
PiperOrigin-RevId: 343202295

Source-Author: Google APIs <[email protected]>
Source-Date: Wed Nov 18 18:55:28 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 2f019bf70bfe06f1e2af1b04011b0a2405190e43
Source-Link: googleapis/googleapis@2f019bf

* build: include osconfig v1 protos into asset v1 Node.js package.

PiperOrigin-RevId: 344904496

Source-Author: Google APIs <[email protected]>
Source-Date: Mon Nov 30 15:48:16 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: a578b42319ca0e3c7b6fec600a4ee9ec57443598
Source-Link: googleapis/googleapis@a578b42
sofisl pushed a commit that referenced this issue Nov 11, 2022
sofisl pushed a commit that referenced this issue Nov 11, 2022
* chore(main): release 5.0.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 17, 2022
🤖 I have created a release \*beep\* \*boop\* 
---
## [2.0.0](https://www.github.com/googleapis/nodejs-compute/compare/v1.2.0...v2.0.0) (2020-05-08)


### ⚠ BREAKING CHANGES

* update to latest version of gts and typescript (#433)
* require node 10 in engines field (#431)

### Features

* require node 10 in engines field ([#431](https://www.github.com/googleapis/nodejs-compute/issues/431)) ([fe2897f](https://www.github.com/googleapis/nodejs-compute/commit/fe2897fd1d625df0ccf5b910ec850e761c2ed6d3))


### Bug Fixes

* apache license URL ([#468](https://www.github.com/googleapis/nodejs-compute/issues/468)) ([#427](https://www.github.com/googleapis/nodejs-compute/issues/427)) ([02d63ed](https://www.github.com/googleapis/nodejs-compute/commit/02d63ed5a5a3559be0b5e49ed4c771b3661518a1))
* **deps:** update dependency @google-cloud/common to v3 ([#421](https://www.github.com/googleapis/nodejs-compute/issues/421)) ([d4469b6](https://www.github.com/googleapis/nodejs-compute/commit/d4469b693745df5a8a36b6988b7dba98f7d55142))
* **deps:** update dependency @google-cloud/paginator to v3 ([#419](https://www.github.com/googleapis/nodejs-compute/issues/419)) ([e667aee](https://www.github.com/googleapis/nodejs-compute/commit/e667aeecf7b9f51875c06cb6a885040828dc1181))
* **deps:** update dependency @google-cloud/projectify to v2 ([#418](https://www.github.com/googleapis/nodejs-compute/issues/418)) ([b861540](https://www.github.com/googleapis/nodejs-compute/commit/b861540aa17118a7508c7c970d84864a9028f588))
* **deps:** update dependency @google-cloud/promisify to v2 ([#417](https://www.github.com/googleapis/nodejs-compute/issues/417)) ([eedce75](https://www.github.com/googleapis/nodejs-compute/commit/eedce75e0d3f10dfed8151f12150d38d032f6a27))
* **deps:** update dependency @sendgrid/mail to v7 ([#424](https://www.github.com/googleapis/nodejs-compute/issues/424)) ([17af0f4](https://www.github.com/googleapis/nodejs-compute/commit/17af0f425354b261f9afc8ab30e16e66b7193fec))


### Build System

* update to latest version of gts and typescript ([#433](https://www.github.com/googleapis/nodejs-compute/issues/433)) ([a4fa8cc](https://www.github.com/googleapis/nodejs-compute/commit/a4fa8cc21df7a894486832b05449fa7afc02b7ee))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
sofisl pushed a commit that referenced this issue Nov 18, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
sofisl pushed a commit that referenced this issue Sep 14, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/6be78fc1-147d-40e3-a003-ed65fa912e63/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@89c849b
Source-Link: googleapis/synthtool@a783321
Source-Link: googleapis/synthtool@b7413d3
Source-Link: googleapis/synthtool@5f6ef0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants