SFDO-Tooling / MetaDeploy

Salesforce.org's managed package installer
https://install.salesforce.org
BSD 3-Clause "New" or "Revised" License
46 stars 45 forks source link

Heroku builds fail when OMNIOUT_TOKEN config var is not set #3527

Closed FranciscoJOlmos closed 6 months ago

FranciscoJOlmos commented 1 year ago

I'm unable to get the application to load once deployed to Heroku. I've attempted to review the documentation for any new changes on deploying the app, but I wasn't able to find anything.

I synced my forked repo recently, up to the latest pull request SFDO-Tooling#3526 from SFDO-Tooling/remove-mock-key.

The build fails and this is the build log from Heroku.

Installing dependencies Installing node modules (yarn.lock) yarn install v1.22.19 error An unexpected error occurred: "Failed to replace env in config: ${OMNIOUT_TOKEN}". info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_55486f80/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. -----> Build failed

I attempted to rollback changes to the last commit i remember working for me, but now i'm unable to get the app to load properly. I attempted to roll back to the commit on Jun 30, 2023 Remove mock DB_ENCRYPTION_KEY (https://github.com/SFDO-Tooling/MetaDeploy/pull/3516[)](https://github.com/akacrm/MetaDeploy/commit/aa7df15025f587f469d34d3eb4f965ffa423f488)

This is the error log from Heroku.

2023-08-30T15:56:24.000362+00:00 app[devworker.1]: 15:56:24 system | worker_short_dev.1 started (pid=17) 2023-08-30T15:56:32.000000+00:00 app[api]: Build succeeded 2023-08-30T15:57:07.284839+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=aka-metadeploy.herokuapp.com request_id=56dd89dc-7398-4458-902e-fdb0fe21590a fwd="71.136.128.176" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https 2023-08-30T15:58:20.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-concentric-67491 sample#active-connections=1 sample#load-avg-1m=0.45 sample#load-avg-5m=0.725 sample#load-avg-15m=0.555 sample#read-iops=0 sample#write-iops=0 sample#memory-total=16070628kB sample#memory-free=9670368kB sample#memory-cached=3290776kB sample#memory-redis=1587384bytes sample#hit-rate=0.51175 sample#evicted-keys=0 2023-08-30T15:58:32.711383+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | Traceback (most recent call last): 2023-08-30T15:58:32.711484+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/connection.py", line 611, in connect 2023-08-30T15:58:32.711574+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | sock = self.retry.call_with_retry( 2023-08-30T15:58:32.711655+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/retry.py", line 46, in call_with_retry 2023-08-30T15:58:32.711734+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | return do() 2023-08-30T15:58:32.711813+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/connection.py", line 612, in <lambda> 2023-08-30T15:58:32.711894+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | lambda: self._connect(), lambda error: self.disconnect(error) 2023-08-30T15:58:32.713187+00:00 app[devworker.1]: 15:58:32 worker_dev.1 | Error 110 connecting to ec2-54-174-32-53.compute-1.amazonaws.com:12689. Connection timed out. 2023-08-30T15:58:32.715892+00:00 app[devworker.1]: 15:58:32 worker_short_dev.1 | Error 110 connecting to ec2-54-174-32-53.compute-1.amazonaws.com:12689. Connection timed out. 2023-08-30T15:58:32.717693+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/connection.py", line 677, in _connect 2023-08-30T15:58:32.717788+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | raise err 2023-08-30T15:58:32.717864+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/connection.py", line 665, in _connect 2023-08-30T15:58:32.717935+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | sock.connect(socket_address) 2023-08-30T15:58:32.718007+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | TimeoutError: [Errno 110] Connection timed out 2023-08-30T15:58:32.718077+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | 2023-08-30T15:58:32.718145+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | During handling of the above exception, another exception occurred: 2023-08-30T15:58:32.718214+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | 2023-08-30T15:58:32.718302+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | Traceback (most recent call last): 2023-08-30T15:58:32.718353+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/manage.py", line 23, in <module> 2023-08-30T15:58:32.718411+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | execute_from_command_line(sys.argv)2023-08-30T15:58:32.718472+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line 2023-08-30T15:58:32.718530+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | utility.execute() 2023-08-30T15:58:32.718588+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute 2023-08-30T15:58:32.718645+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | self.fetch_command(subcommand).run_from_argv(self.argv) 2023-08-30T15:58:32.718727+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv 2023-08-30T15:58:32.718784+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | self.execute(*args, **cmd_options) 2023-08-30T15:58:32.718845+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute 2023-08-30T15:58:32.718909+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | output = self.handle(*args, **options) 2023-08-30T15:58:32.718962+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/metadeploy/management/commands/metadeploy_rqscheduler.py", line 48, in handle 2023-08-30T15:58:32.719021+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | register_cron_jobs(settings.CRON_JOBS, queue_name) 2023-08-30T15:58:32.719082+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/metadeploy/management/commands/metadeploy_rqscheduler.py", line 22, in register_cron_jobs 2023-08-30T15:58:32.719146+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | for job in list(scheduler.get_jobs()): 2023-08-30T15:58:32.719199+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/rq_scheduler/scheduler.py", line 343, in get_jobs 2023-08-30T15:58:32.719260+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | job_ids = self.connection.zrangebyscore(self.scheduled_jobs_key, 0, 2023-08-30T15:58:32.719320+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/commands/core.py", line 4519, in zrangebyscore 2023-08-30T15:58:32.719493+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | return self.execute_command(*pieces, **options) 2023-08-30T15:58:32.719579+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/client.py", line 1235, in execute_command 2023-08-30T15:58:32.719645+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | conn = self.connection or pool.get_connection(command_name, **options) 2023-08-30T15:58:32.719704+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/connection.py", line 1387, in get_connection 2023-08-30T15:58:32.719772+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | connection.connect() 2023-08-30T15:58:32.719831+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | File "/app/.heroku/python/lib/python3.9/site-packages/redis/connection.py", line 617, in connect 2023-08-30T15:58:32.719895+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | raise ConnectionError(self._error_message(e)) 2023-08-30T15:58:32.719956+00:00 app[devworker.1]: 15:58:32 worker_scheduler.1 | redis.exceptions.ConnectionError: Error 110 connecting to ec2-54-174-32-53.compute-1.amazonaws.com:12689. Connection timed out. 2023-08-30T15:58:33.006280+00:00 app[devworker.1]: 15:58:33 system | worker_scheduler.1 stopped (rc=1) 2023-08-30T15:58:33.006334+00:00 app[devworker.1]: 15:58:33 system | sending SIGTERM to worker_dev.1 (pid 13) 2023-08-30T15:58:33.006393+00:00 app[devworker.1]: 15:58:33 system | sending SIGTERM to worker_short_dev.1 (pid 17) 2023-08-30T15:58:33.014956+00:00 app[devworker.1]: 15:58:33 system | worker_short_dev.1 stopped (rc=-15) 2023-08-30T15:58:33.015449+00:00 app[devworker.1]: 15:58:33 system | worker_dev.1 stopped (rc=-15) 2023-08-30T15:58:33.264182+00:00 heroku[devworker.1]: Process exited with status 1 2023-08-30T15:58:33.294889+00:00 heroku[devworker.1]: State changed from up to crashed 2023-08-30T15:59:09.361676+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=aka-metadeploy.herokuapp.com request_id=40fe3d4d-9c4a-451d-8b94-79fa27252516 fwd="71.136.128.176" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https 2023-08-30T15:59:23.807926+00:00 app[web.1]: 10.1.89.36:31047 - - [30/Aug/2023:15:59:23] "WSCONNECTING /ws/notifications/" - - 2023-08-30T15:59:28.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-concentric-67491 sample#active-connections=1 sample#load-avg-1m=0.42 sample#load-avg-5m=0.61 sample#load-avg-15m=0.53 sample#read-iops=0 sample#write-iops=0.1068 sample#memory-total=16070628kB sample#memory-free=9672288kB sample#memory-cached=3291464kB sample#memory-redis=1587384bytes sample#hit-rate=0.51175 sample#evicted-keys=0 2023-08-30T15:59:28.001837+00:00 app[web.1]: 10.1.89.36:31047 - - [30/Aug/2023:15:59:28] "WSDISCONNECT /ws/notifications/" - - 2023-08-30T15:59:28.003029+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/ws/notifications/" host=aka-metadeploy.herokuapp.com request_id=9eec67cb-af7d-4c2d-bffb-ba3771a4349d fwd="72.198.125.194" dyno=web.1 connect=0ms service=4196ms status=503 bytes=0 protocol=https 2023-08-30T15:59:30.321440+00:00 app[web.1]: 10.1.89.99:13279 - - [30/Aug/2023:15:59:30] "WSCONNECTING /ws/notifications/" - - 2023-08-30T15:59:35.003219+00:00 app[web.1]: 10.1.89.99:13279 - - [30/Aug/2023:15:59:35] "WSDISCONNECT /ws/notifications/" - - 2023-08-30T15:59:35.004695+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/ws/notifications/" host=aka-metadeploy.herokuapp.com request_id=bff151ea-1301-4011-ae44-2163f35ccb30 fwd="72.198.125.194" dyno=web.1 connect=0ms service=4683ms status=503 bytes=0 protocol=https 2023-08-30T15:59:48.604716+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=aka-metadeploy.herokuapp.com request_id=4f3fc65b-15fd-4ffc-9617-85adeb63c8fd fwd="71.136.128.176" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https 2023-08-30T16:00:14.961248+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/products/EducationCloudTemplate/latest" host=aka-metadeploy.herokuapp.com request_id=a9a304cf-ff76-4317-9248-34bfb6820f8a fwd="71.136.128.176" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https

Any help to get our app working again would be greatly appreciated.

jstvz commented 1 year ago

Thanks for the report, @FranciscoJOlmos.

The root cause is related to changes we made in #3518 to improve Omnistudio support. We'll see if we can make this work for external users who don't have access to the private NPM repository, but in the meantime you should be able to work around this by either:

  1. Rolling back your fork to before #3518, or
  2. Adding the OMNIOUT_TOKEN config var to your Heroku app. However, I'd expect a different error message because we declared @omnistudio/omniscript-lwc-compiler as a dependency.

I suggest going with (1) until we back out the dependency or figure out a better way to do this.

FranciscoJOlmos commented 1 year ago

@jstvz life saver! I rolled back, and our app is working now, Thank you!

RupertBarrow commented 7 months ago

How can we work around this in February 2024 ? Will we not benefit from any fixes or features added after #3518 ?

jstvz commented 6 months ago

@RupertBarrow This dependency was made optional in #3540. The workaround I suggest is to:

  1. Add .npmrc to your fork's .slugignore or delete it, and
  2. Add --install.ignore-optional true to your fork's .yarnrc
joeythomaschaske commented 4 months ago

@RupertBarrow This dependency was made optional in #3540. The workaround I suggest is to:

1. Add `.npmrc` to your fork's `.slugignore` or delete it, and

2. Add `--install.ignore-optional true` to your fork's `.yarnrc`

I've followed these steps and I still am getting the same error.

I don't think --install.ignore-option true works as intended after reviewing these links

Can this issue be reopened?

posigithub commented 4 months ago

Can this issue be reopened?

jstvz commented 4 months ago

@joeythomaschaske @posigithub I want to clarify a few points to help everyone move forward:

  1. We need the VBT local compiler for our project and can't remove it.
  2. We don't officially support forks, so we can't ensure our main project changes work in forks.
  3. You're free to change your fork to remove the compiler if it helps.
  4. If you've found a fix that we missed that works for our use case, please share it with us!

We won't reopen the closed issue, but we're open to new solutions that could benefit everyone.