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
1.4rc : assets:precompile fails #3251
Comments
Did you launch |
@Aldarone |
I have followed the following steps, and the same thing happen.
|
Downgrading yarn to 0.18.2 works for me, but I don't understand why this works. --- a/Dockerfile
+++ b/Dockerfile
@@ -34,7 +34,7 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit
protobuf \
su-exec \
tini \
- && npm install -g npm@3 && npm install -g yarn \
+ && npm install -g npm@3 && npm install -g yarn@0.18.2 \
&& update-ca-certificates \
&& rm -rf /tmp/* /var/cache/apk/* |
we also encountered the error on v1.4rc[2-3].
|
That also happens for me. I runs the task on Arch Linux and copies
|
In my case it was killed by OOM killer. Increasing RAM from 1GB to 2GB solved the issue. |
rails/webpacker@158987a#diff-e36986293b3ec8ccf91a5c317454efcfR20 seems to fix the issue, by abandoning JSON parsing when it failed. |
Reports from skoji, kabuakan and tusik (in #3273) include below lines:
Webpack ( Also I found a similar report on yarnpkg/yarn#3298, but it doesn't seem to be investigated yet. |
Oh, yes. That is just a fix for error handling. |
Maybe this is related: [...]
Webpacker is installed 🎉 🍰
Using /mastodon/config/webpack/paths.yml file for setting up webpack paths
Compiling webpacker assets 🎉
rails aborted!
JSON::ParserError: 743: unexpected token at 'Webpack Bundle Analyzer saved stats file to /mastodon/public/packs/stats.json
Webpack Bundle Analyzer saved report to /mastodon/public/packs/report.html
'
/mastodon/vendor/bundle/ruby/2.4.0/gems/webpacker-1.2/lib/tasks/webpacker/compile.rake:13:in `block (2 levels) in <top (required)>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/webpacker-1.2/lib/tasks/webpacker/compile.rake:40:in `block in <top (required)>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.0.3/lib/rails/commands/rake_proxy.rb:14:in `block in run_rake_task'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.0.3/lib/rails/commands/rake_proxy.rb:11:in `run_rake_task'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.0.3/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/mastodon/vendor/bundle/ruby/2.4.0/gems/railties-5.0.3/lib/rails/commands.rb:18:in `<top (required)>'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-0.2.14/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/bootsnap-0.2.14/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:293:in `block in require'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:259:in `load_dependency'
/mastodon/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:293:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => webpacker:compile
(See full trace by running task with --trace)``` |
The main issue I see in the original post is:
@jeroenpraat Your error looks different; oddly it seems to be caused by the |
I didn't encounter this when installing mastodon.social, and I had to setup another instance using Docker and didn't encounter this either - so what's different in these cases? |
Before running But after the unsuccessful
|
I have set up Docker on my CentOS and it worked. The only difference from @skoji's is it is running yarn install v0.24.5, not v0.24.4. |
I confirmed it works for me even with v0.24.4. |
@nolanlawson Thanks, I will open a separate issue. |
Maybe this issue caused by the bug of yarn which is fixed in yarn 0.25.3. I'll check this. |
Got the same problem with v1.4.1 and it was an OOM issue, solved with some additionnal RAM allocated to my container. |
My instance's front is down because of this issue. The 1.4 should not have been out of RC with this kind of issue still present! |
0.25.3 does not work. |
I've tested on a machine with 4GB memory + 2GB swap, and the problem is still there. |
Hm, can you try disabling the To disable it, just comment out these lines. |
Errrr wait, are you still seeing |
Also, for anyone feeling absolutely stuck on this issue: you can always |
I'm still getting this issue, not sure how to resolve:
|
@bgcarlisle Looks like that's a completely different error: |
Apologies, still stumped though! |
Hi, I confirm that the docker image 1.4.1 failed because of yarn ... |
Mine turned out to be messed up because I didn't have enough RAM Used a swap file and now it's up and running! |
I tried this on my mac (16GB memory / 2GB memory for Docker). This works for me. |
I encountered same issue. My server memory is 2GB, and swap is 1GB. I'll investigate deeply, and try to fix it.
I don't have computer that has big/huge memory... |
@takutaku947 You should do something like this:
(You can install newer yarn by editing |
@skoji Yes, I meant "upgrade". Thank you for let me know. I'll try it after sleep!(6AM, trying to fix all night!) ありがとう(Thanks again)! |
I woke up and running job in background. Now, I solved that problem. Thank you! |
I don't know why. |
Not running docker, and was having this problem -- I can confirm it was because of RAM, weirdly enough! Running mastodon on a VM with 2GB of RAM, and the assets:precompile would only work when I killed off a lot of other junk running on the server to free up RAM. |
In v1.4.4 |
I think the problem in the original post is fixed, so closing this issue. |
The "fix" is not really working, the issue is a lot more than just yarn version. The issue is that assets:precompile uses too much ram for what it does and real tests should be used to determine if it's using an acceptable amount of memory now. |
Maybe there are still some other problems in the process of If there is a different problem, a different issue is needed for that. |
I've got the exact issue reported here with suggested yarn version used to "fix" this issue in v1.4.1. I still haven't tried to upgrade to latest version because of that. |
@Naouak v1.4.4 works for me without the workaround (specify yarn version). |
assets:precompile
fails on v1.4rc{1,2,3}. and v1.4.1v1.3.3 works fine on the same machine.
CentOS 7.3.1611
Kernel 3.10.0-514.16.1.el7.x86_64
Docker version 17.03.1-ce, build c6d412e
docker-compose version 1.13.0, build 1719ceb
[Edited]
Phisical memory: 1GB
swap file : 2GB
Result:
master
(If you're a user, don't worry about this).The text was updated successfully, but these errors were encountered: