Unable to update to lastest master

When trying to update sentry I’m getting the following:

building assets for sentry v8.21.0.dev0 (build ceb8389c54d29f80b27703bb76c3880d923a3a5a)
    throw err;

Error: Cannot find module 'camelcase'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/manu/src/github.com/provision/sentry/node_modules/yargs/lib/command.js:3:19)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
command failed [node_modules/.bin/webpack --bail] via [/home/manu/src/github.com/provision/sentry]
Traceback (most recent call last):
  File "/home/manu/src/github.com/provision/sentry/src/sentry/utils/distutils/commands/build_assets.py", line 117, in _build
  File "/home/manu/src/github.com/provision/sentry/src/sentry/utils/distutils/commands/build_assets.py", line 139, in _build_static
    self._run_command(['node_modules/.bin/webpack', '--bail'], env=env)
  File "/home/manu/src/github.com/provision/sentry/src/sentry/utils/distutils/commands/base.py", line 150, in _run_command
    return check_output(cmd, cwd=self.work_path, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['node_modules/.bin/webpack', '--bail']' returned non-zero exit status 1
unable to build Sentry's static assets!
Hint: You might be running an invalid version of NPM.

I’m using npm 5.3.0 and the current master (commit: ceb8389c54d29f80b27703bb76c3880d923a3a5a)

I realize that if I run yarn, the camelcase node_modules get installed, but it’s somehow removed when python setup.py develop runs.

So I modified the file ‘src/sentry/utils/distutils/commands/build_assets.py’ like this:

$ git diff
diff --git a/src/sentry/utils/distutils/commands/build_assets.py b/src/sentry/utils/distutils/commands/build_assets.py
index c631cc326..6abc66bb7 100644
--- a/src/sentry/utils/distutils/commands/build_assets.py
+++ b/src/sentry/utils/distutils/commands/build_assets.py
@@ -134,6 +134,8 @@ class BuildAssetsCommand(BaseBuildCommand):
         #   * React optimizes out certain code paths
         #   * Webpack will add version strings to built/referenced assets
         env = dict(os.environ)
+        self._run_command(['yarn'], env=env)
         env['SENTRY_STATIC_DIST_PATH'] = self.sentry_static_dist_path
         env['NODE_ENV'] = 'production'
         self._run_command(['node_modules/.bin/webpack', '--bail'], env=env)

Now I’m getting another unrelated error because I can’t sync the documentation:

    at next (/srv/sentry8/src/sentry/node_modules/tapable/lib/Tapable.js:231:35)
resolve 'integration-docs-platforms' in '/srv/sentry8/src/sentry/src/sentry/static/sentry/app/views/onboarding'
  Parsed request is a module
  using description file: /srv/sentry8/src/sentry/package.json (relative path: ./src/sentry/static/sentry/app/views/onboarding)
    aliased with mapping 'integration-docs-platforms': '/srv/sentry8/src/sentry/src/sentry/integration-docs/_platforms.json' to '/srv/sentry8/src/sentry/src/sentry/integration-docs/_platforms.json'

It’s a bug in yarn 1.x and hasn’t yet been fixed. Our recommendation is to downgrade yarn, clear node_modules, and run the package installed again.

Sorry missed the tail end. Not sure if it’s related but it only looks to be half a traceback. Is there more?

It was a very long traceback. Unfortunately I didn’t copy the whole thing.

I managed to upgrade by applying the changes in https://github.com/getsentry/sentry/pull/6132

The commit https://github.com/getsentry/sentry/pull/6132/commits/9f7f3fe649c7fcd03df7d3d31fe6268826966e4b simply ensures to run yarn before running webpack and that solves the issue about the missing camelcase.

The other two commits are related to the fact my server (being located in Cuba) can’t synchronize the documentation.