Suddenly I dont know what happened but I am unable to load any page on localhost because I am getting the above error.I have attached a screeshot of the error. Thank you so much!
See below for yarn install
and yarn update
to resolve this
@shubhscoder its the bootstrap file it specifies I haven't figured out how to fix it though. For me I can run my localhost but all my pushes to unstable fail
Copying @cesswairimu's message from Gitter channel :
After pulling master yesterday I have been getting this error Sprockets::FileNotFound in uncommenting jquery in app/assets/javascripts/application.js seems to solve it. Is there anyone else experiencing this?
it worked for me locally (localhost) when I ran yarn install and yarn upgrade but I don't really understand why it would work locally but not with a push to unstable
I ran the same commands some days back for resolving this issue. We can see unstable
's build log to find if the yarn install is running or not?
https://jenkins.laboratoriopublico.org/job/Plots-Unstable/497/console
it says it runs but is using cache?
That's the issue!
I cleared cache a bunch of times is there a way to set it so that jenkins stops using cache
I found this - https://stackoverflow.com/questions/35594987/how-to-force-docker-for-a-clean-build-of-an-image and let's see if it work or not
@cesswairimu and @shubhscoder you can resolve this issue locally by running commands as mentioned by sasha -https://github.com/publiclab/plots2/issues/4849#issuecomment-464647875 .
@Souravirus @icarito any hint about this issue?
Thanks!
Thank you so much @gauravano !
@sashadev-sky unstable is back to normal.
I just force pushed the master branch on unstable and it's back to normal. You tried the force push, Sasha?
Here's the passed build log - https://jenkins.laboratoriopublico.org/job/Plots-Unstable/499/console
this build also shows the use of cache for some commands but I guess cache wasn't a problem as yarn install
and yarn upgrade
ran normally
the link I posted here resulted in this build - https://jenkins.laboratoriopublico.org/job/Plots-Unstable/500/console
@jywarren @icarito do you know why my build - https://jenkins.laboratoriopublico.org/job/Plots-Unstable/499/console passed but all the builds from https://jenkins.laboratoriopublico.org/job/Plots-Unstable/487/ to https://jenkins.laboratoriopublico.org/job/Plots-Unstable/498 started by @sashadev-sky failed :confused: ?
@gauravano it just started working for you by using --force? It could just be my computer setup
@gauravano is bower still required for proper installation at this point?
@gauravano nevermind mine worked!
@gauravano it just started working for you by using --force? It could just be my computer setup
I always force push on unstable
. I doubt that computer setup has anything to do in it. You can check the changes of your push and see if that's incorrect. I would advise you to use force push too on unstable as I can see that you have to struggle a lot with unstable
in recent hours.
We use yarn with plots2, right?
Did it work? I guess force push was needed because I have changed the bootstrap3-typeahead to typeahead.js for Bootstrap 4. That's why it might not be working.
yes @Souravirus, it worked out after force-push. Thanks for checking in :)
@gauravano @Souravirus yes that was a struggle! I just got a new laptop so it could have been computer related for me, but I had been force pushing the whole time so that was not the solution for me.
What led to it working was re-installing my Homebrew configurations for Docker and building and a docker container. Are we supposed to be building containers before pushing to unstable?
@sashadev-sky I don't use Homebrew, so, I don't have any idea about that.
I don't use homebrew or docker locally too.
On 18/02/19 11:55, Sasha Boginsky wrote:
What led to it working was re-installing my Homebrew configurations
for Docker and building and a docker container. Are we supposed to be
building containers before pushing to unstable?
Hi,
Glad you could work it out!
Docker is used in our case to make development / staging / production as
similar as possible. There is no requirement for it but it simplifies in
theory to have as similar as possible environment as production.
A couple of caveats:
-
https://github.com/publiclab/plots2/blob/master/containers/docker-compose-production.yml#L41
: We mount the application working directory as a /volume/. This means
that public/lib
from your working directory overrides whatever is in
the container. It looks like this breaks build isolation, and seems to
be causing confusion for development and even in production. The reason
is that at the time the docker-compose was written I didn't know (and
still I'm not too familiar) with what access the application needs to
persistence on the filesystem (container filesystems are throwaway).
I've been meaning to open an issue about the topic, not being sure how
it affects everything else - your input and help is much appreciated!
Thanks for responding here and debugging so much! I wonder if this was linked to the yarn.lock and package.json updates I made recently. This has helped us get our JS dependencies much more up to date, but maybe it had an unintended consequence -- if so, apologies!
Does running yarn install
help folks here?
Also noting that this could.... maybe... be related: https://github.com/publiclab/plots2/issues/4853
@cesswairimu how are you doing on this?
@icarito I don't know too deeply about docker setup, I only learned how to build a container recently because I thought I needed it for the unstable branch. The 2nd occasion I used unstable I ended up building it again because of the sprockets errors and using it the 1st time inadvertently had worked for me. Then sprockets error was resolved.
Without using the container the issue is coming up for me again. But in my local environment it is gone after doing yarn install and yarn upgrade once.
What happens if we simply not mount /app
as a volume? In theory this is only needed if the application _writes_ to the filesystem. Do uploads go to a specific dir? If it is the case, we could mount a directory for uploads instead of the whole app directory (at https://github.com/publiclab/plots2/blob/master/containers/docker-compose-production.yml#L41 )
Perhaps mount /app/public/system as volume instead of all of /app - i'll try it in a pull request and we can tests it in unstable. Thanks for the info and help debugging!
@icarito sorry I am trying to follow but I am little confused. This is my understanding please help fix it if you can:
1) when I run docker build on the repo, the docker loads my local settings from my host daemon.
2) Then because of app being specified as a volume, it overrides my local settings with those of app
3) app is just the local plots2 repo I have on my computer
4) so it creates a plots2 image of my repo at that moment in time. and this build succeeds. Which makes sense because I am also able to run app in localhost successfully
5) if all of this is the case, then what am I sending to Jenkins before building the image that causes it to fail? and what am I sending after that is different?
But in my local environment it is gone after doing
yarn install
andyarn upgrade
once.
This is great to hear, and perhaps we just need to add better docs on running these to resolve this issue?
The Docker config discussion sounds important too, but for those just arriving, the yarn install
and yarn upgrade
solution seems to resolve this. Thanks, all!
Hi everyone,
If the unstable build is failing due to this error: Sprockets::FileNotFound: couldn't find file 'bootstrap-3-typeahead/bootstrap3-typeahead.min.js' with type 'application/javascript'
. Then you can remove this asset from app/assets/javascript/application.js. This fix is working for now.
Hi, thanks Sourav - is there any change required for the master branch, to
resolve this for everyone? Or is it required to run some step on unstable
like yarn install
or something to make this go away? Thanks!
On Sun, Mar 3, 2019 at 11:40 PM Sourav Sahoo notifications@github.com
wrote:
Hi everyone,
If the unstable build is failing due to this error: Sprockets::FileNotFound:
couldn't find file 'bootstrap-3-typeahead/bootstrap3-typeahead.min.js' with
type 'application/javascript'. Then you can remove this asset from
app/assets/javascript/application.js. This fix is working for now.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4849#issuecomment-469116322,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ22atj9TNi_csDfpr7RixinV7fZrks5vTKOtgaJpZM4bASqv
.
Hi @jywarren, I think that there is some problem with the yarn.lock which isn't being updated after adding or removing a package. I guess removing the yarn.lock from the .gitignore file might work because I guess the result of the changes in the package.json might not get updated in the yarn.lock. That's why when I deleted the typeahead package from the package.json, everyone's build failed in unstable after that.
The same problem happened to me today. The bootstrap that was installed at first was bootstrap 3 and then when I sent a commit later it was then updated to Bootstrap 4.
@Souravirus I have noticed inconsistencies between them too, but there is a copy of yarn.lock in the remote repo? I think the configuration set up for yarn could be problematic, let me know what you think:
.yarnrc has the following:
--install.modules-folder "./public/lib"
ignore-scripts true
ignore-engines true
which is saying we configured yarn so that it does not run any scripts from package.json. But when we run yarn install
, it runs the postinstallscript
in package.json
anyway. And the postinstallscript
creates symlinks to a bower components
folder (which i think we definitely should remove if we are not using bower anymore). Yarn upgrade
however ignores the script. Is that the behavior that was expected when it was set up?
and also in package.json
we put yarn as an engine
, yet in .yarnrc
we have --ignore-engines
Hi @sashadev-sky, the ignore-engines is done to tackle this incompatibility error:
[email protected]: The engine "node" is incompatible with this module. Expected version "0.8.x"
which was being removed with this --ignore-engine options following this link.
Also, there was some error with the phantomjs, which were removed by the --ignore scripts.
Here is the full error.
So, I think these scripts were required at the time installation.
@Souravirus hmm I don't know much about best practice for yarn setup, just pointing out behavior I thought was strange. But since bower is deprecated I definitely think we should remove or change the current postinstall script. Not a huge deal but don't need those extra symlinks. Perhaps a quick change just to make if you're already playing around with yarn in a PR
@Souravirus also I found the postinstall script to be really useful for debugging if you put a throw e
and a conditional of your choice in there. Maybe you will know what to check for to fix your problem :)
Yeah, I think the postinstall script should be removed for now. If you can send a PR for it, then it would be great.
@souravirus will do
@Souravirus opened an FTO for this via #5037
Run yarn install
and yarn update
to resolve this.
Thanks all
Most helpful comment
This is great to hear, and perhaps we just need to add better docs on running these to resolve this issue?
The Docker config discussion sounds important too, but for those just arriving, the
yarn install
andyarn upgrade
solution seems to resolve this. Thanks, all!