Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Instabug source map upload returns 500 Internal Server Error #1393

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

Open
naveen-pf opened this issue May 19, 2025 · 1 comment
Open

Instabug source map upload returns 500 Internal Server Error #1393

naveen-pf opened this issue May 19, 2025 · 1 comment

Comments

@naveen-pf
Copy link

Hi Instabug team,

I'm trying to upload source maps for React Native using your https://api.instabug.com/api/sdk/v3/symbols_files endpoint.

Here’s the relevant part of my code that generates the sourcemap and uploads it via curl:

`const {execSync} = require('child_process');
const {getConfig} = require('@expo/config');
const path = require('path');

const {exp} = getConfig(process.cwd());
const args = process.argv.slice(2);

const channel = args.includes('--channel')
? args[args.indexOf('--channel') + 1]
: 'staging';

const platformList = ['ios', 'android'];

const appVersion = process.env.APP_VERSION || '1.0.0';
const buildNumber = process.env.BUILD_NUMBER || '10001';
const environment = channel === 'production' ? 'production' : 'staging';
const instabugToken =
channel === 'production'
? exp.extra.instabugKeys.Production
: exp.extra.instabugKeys.Staging;

const codePushVersion = execSync('git rev-parse --short HEAD')
.toString()
.trim();

console.log(📦 App Version: ${appVersion});
console.log(📦 Build Number: ${buildNumber});
console.log(📦 Environment: ${environment});
console.log(📦 CodePush Version: ${codePushVersion});
console.log(📦 Instabug Token: ${instabugToken});
console.log(📦 Channel: ${channel});

console.log(🔁 Running EAS Update for channel: ${channel}...);
// execSync(npx eas update --channel ${channel} --non-interactive --message "OTA Update for ${channel}", {
// stdio: 'inherit',
// });

console.log('📦 Bundling and uploading source maps for Instabug...');

platformList.forEach((platform) => {
const bundleDir = ./dist/bundles/${platform};
const entryFile = 'index.js';
const sourcemapPath = path.resolve(${bundleDir}/${platform}-sourcemap.json);
const bundlePath = path.resolve(${bundleDir}/index.${platform}.bundle);

// Step 1: Bundle the app
execSync(
npx react-native bundle \ --entry-file ${entryFile} \ --platform ${platform} \ --dev false \ --bundle-output ${bundlePath} \ --sourcemap-output ${sourcemapPath} \ --assets-dest ${bundleDir},
{stdio: 'inherit'},
);

// Step 2: Upload using curl
const versionJson = JSON.stringify({
name: appVersion,
code: buildNumber,
codepush: codePushVersion,
});

const curlCommand = curl --trace-ascii ./instabug-curl.log --fail-with-body -X POST https://api.instabug.com/api/sdk/v3/symbols_files \ -F "symbols_file=@${sourcemapPath}" \ -F "application_token=${instabugToken}" \ -F "platform=react_native" \ -F "os=${platform}" \ -F "app_version=${versionJson}";

console.log(📤 Uploading source map for ${platform}...);
execSync(curlCommand, {stdio: 'inherit'});

console.log(✅ Source map uploaded for ${platform} platform.);
});
`

❌ Problem
The API returns:

{"status":500,"error":"Internal Server Error"}

Even though the sourcemap and bundle are valid files, and the upload appears to succeed (no curl error).

I’ve already added --trace-ascii to get internal curl logs, but the response body is not helpful beyond the 500.

Can you help identify what could be wrong or validate whether the app_version format or file MIME type could be causing the 500?

Thanks!
Naveen

@AyaMahmoud148
Copy link
Contributor

Hi @naveen-pf we're looking into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants