webpack-bugsnag-plugins icon indicating copy to clipboard operation
webpack-bugsnag-plugins copied to clipboard

Error: Conflict (409) - duplicate source map file for file name

Open Suraj-Chandola opened this issue 7 years ago • 14 comments

While uploading source map using webpack-bugsnag-plugins, i am getting this error Error: Conflict (409) - duplicate source map file for file name

Suraj-Chandola avatar Aug 20 '18 11:08 Suraj-Chandola

Hi @Suraj-Chandola – by default the source map upload API does not allow duplicates to be uploaded. If you want to be able to replace an already uploaded source map for the same app version / url, set the overwrite option in plugin to be true. e.g

new BugsnagSourceMapUploaderPlugin({
  apiKey: 'YOUR_API_KEY',
  appVersion: '1.2.3',
  overwrite: true
})

Hope this helps. If it doesn't, let me know. Otherwise you can write in to [email protected].

bengourley avatar Aug 20 '18 12:08 bengourley

Is it not true by default?

snmaynard avatar Aug 20 '18 16:08 snmaynard

The default value in bugsnag-sourcemaps is false and this library doesn't set anything.

bengourley avatar Aug 20 '18 19:08 bengourley

@bengourley Thanks

Suraj-Chandola avatar Aug 21 '18 06:08 Suraj-Chandola

This caught me, seems like overwrite should be true by default.

jgentes avatar Dec 03 '18 15:12 jgentes

Thanks @bengourley! --overwrite true works fine!

buskerone avatar Jan 31 '19 10:01 buskerone

This should be by default, my jenkins build just stalled over this.

simkessy avatar May 04 '20 18:05 simkessy

Thanks for your thoughts @simkessy. We will look into changing the default behaviour to overwrite.

abigailbramble avatar May 11 '20 09:05 abigailbramble

I think I would like to bump this feature request. Using a gitops approach our "postSync" job handles the bugsnag source map uploads, we sync whenever there is a config change to our k8 resources in git so we end up uploading a lot for the same version number.

Can definitely just update it in code at the plugin level but just wanted to share my experience.

michaellarocca90 avatar Sep 17 '20 03:09 michaellarocca90

Hi @michaellarocca90,

Thanks. We've decided to leave the default as false for consistency with our other tools. Setting the overwrite flag as true when required is the recommended approach and we will be updating our documentation shortly to better clarify this behaviour.

johnkiely1 avatar Sep 21 '20 13:09 johnkiely1

@johnkiely1 It would be great to have a self-explaining error message. Could have saved some hours here :)

currently:

10:37:45 AM: [BugsnagSourceMapUploaderPlugin] uploading sourcemap for "https://example.com/1.4dc3d740546da926e43a.js"
10:37:45 AM: An unhandled exception occurred: HTTP status 409 received from upload API

Preferred

10:37:45 AM: [BugsnagSourceMapUploaderPlugin] uploading sourcemap for "https://example.com/1.4dc3d740546da926e43a.js"
10:37:45 AM: [BugsnagSourceMapUploaderPlugin] Error uploading sourcemap: This sourcemap has previously been uploaded. Use the option { overwrite: true} to enable overwriting of existing sourcemaps

rechl avatar Sep 23 '20 08:09 rechl

@sgotre The self-explaining error message seems a sensible suggestion. I'll re-open this to track making that change to the error message.

mattdyoung avatar Sep 24 '20 15:09 mattdyoung

Any news on

  • defaulting to true
  • an option to not have this error halt an entire build?

Haraldson avatar Aug 08 '22 09:08 Haraldson

Hi @Haraldson, this is still in our backlog. Other priorities have meant we have been unable to get around to this yet. We will post here once we have any updates on this!

Cga95 avatar Aug 09 '22 09:08 Cga95