There are numerous missing javascript files. These were the first ones found.
Initial review:
The files are not available via my CDN delivery.
The CDN pulls from my S3 bucket.
The files are not in my S3 bucket where all other assets are stored.
Looking at the rebuild results, I can see the following.
The 4 files were created and written to public/assets/ with a js file extension.
The 4 files were compressed and saved with a br.js file extension.
Checking my server:
All 4 .js files are available on my server
The .br.js files are not available on my server
The .br.js files are not on my S3 bucket
Going through the rebuild results, It appears the after_assets_precompile activity is not happening on my rebuilds. I can manually run a rake s3:upload_assets and the assets are migrated to S3 and everything works well.
I have checked the following:
my yml file passes checks for proper formatting.
What can I check to determine why the after_assets_precompile is not processing as part of the rebuild?
You can find that rake task there and then run it from inside the container (to save the time of a rebuild). And then do a rebuild once you edit your yml file.
S3 has been up and running on the site for 43 days. The rake commands were placed there as part of the S3 install.
The site has been rebuilt at least 30 times. I have added additional plugins and components along the way. This would indicate that .js files have been added and populated to the S3 bucket.
The S3 component has been working great. This is the first time I have had any issues with files not being migrated to S3.
What can I investigate to understand why the files were not moved?
Does anyone know what could cause the after_assets_precompile not to run?
As a test, I moved the after_assets_precompile commands to the custom command section.
run:
- exec: echo "Beginning of custom commands"
## If you want to set the 'From' email address for your first registration, uncomment and change:
## After getting the first signup email, re-comment the line. It only needs to run once.
#- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
## command to password protect the website during work. remove for production.
- exec:
cd: $home
cmd:
- echo "Beginning of precompile commands"
- sudo -E -u discourse bundle exec rake s3:upload_assets
- sudo -E -u discourse bundle exec rake s3:expire_missing_assets
- exec: echo "End of custom commands"
The commands worked without any issues. This rules out environmental access or security issues.
The launcher process is skipping the after_assets_precompile code during the rebuild.
@supermathie - you are terrific with incredible eyesight. You were able to see that the code was not indented by two spaces. And only from a single snippet versus the more extensive section. Thank you.
I added the two spaces, and that solved the problem.
I had previously run app.yml through a yml checker. The testing tool told me the file was structurally sound. It could not tell me it was functionally wrong.