CSS not rendering at puppeteer inside docker - docker

I have automated browser tests using puppeteer. I ran them at Circle CI using default Circle CI windows machine. Now I'm trying to change to a docker which is based on a Microsoft Debian machine (the website is .NET). I installed chromium at this machine. The problem is the CSS is not rendered. I used page.on request/response and the css is requested, response is 200. I looked for a configuration that could be disabled, but I didn't find it - neither at StackOverflow.
Repository: https://github.com/darakeon/dfm/
Branch right now: 4.1.5.0 (it will be promoted to master when I finish the version)
The dockerfile is inside docker folder. It is at Docker Hub too, my user is darakeon. Right now the name is darakeon/net-circleci. When I solve the problem, I will rename this, to split into 2 different machines - one based on microsoft which has only libman, another based on the first, that can run puppeteer too.
Tests folder: site/Tests/Browser
Script I'm using to run tests: .circleci/browser/run-tests.sh
The most time you spent trying to solve something, the more ridiculous will be the solution. Please, call me idiot, but help me to solve this...

Discovered the problem. Here is how:
I used page.screenshot at another site on the web to check if the css was rendering at it. It was. Weird. After looking for solutions, I was always finding people teaching how to NOT show the css, intercepting the request and stopping it. So I intercepted the requests to see if the css was being requested:
await page.setRequestInterception(true);
page.on('request', (req) => {
console.log(req.url(), req.resourceType())
req.continue();
})
Given the requests were ok, I went to check the responses:
page.on('response', (r) => {
if (r.status() >= 400)
console.error(r.url(), r.status())
})
Surprise! My main css was returning 404. But why, if it worked at windows? Simple. Windows doesn't care if you call Bootstrap, bootstrap, bOOTSTRAP or BoOtStRap, them all will search the same file. Linux consider as right just the exactly same case.
So, when you get your .NET site from windows and put it at Linux, check the cases of everything.

Related

Gitlab Pages delivers random content

I am experiencing weird behavior with the Pages feature of GitLab Omnibus package running on an Ubuntu 16.04 virtual machine. Some projects use Pages with Jekyll built by GitLab CI, which has been working as expected since it was first published with Gitlab CE.
For a couple of days now, visiting any of the homepages of those sites shows the content of just one of the projects. Each of them should of course show different content, but they all show the same. Even stranger: the content shown on each of the sites changes over time to one of the other projects, and I can not see whether this is deterministic.
Restarting the build processes of each of the projects did not fix this, neither did gitlab-ctl reconfigure, stop and start, nor rebooting the entire VM.
To investigate on that issue, I edited (which I assume is) the resulting file of the build process at /var/opt/gitlab/gitlab-rails/shared/pages/www/www.domain.org/public/index.html. Not in the first place, but later on during the already stated "rotating" content, the edits showed up on the webpage.
So what is going on there? Is this some caching issue? Is it malconfiguration? Is it a bug? Please help me find and fix the problem, as those are production websites.
Looks like this is actually an issue

Docker reload does not reflect changes in CSS files

I've configured docker to reload automatically when i make changes to my project files. It works fine when i make changes in HTML or .py files but does not reflect any changes to CSS files. this question has also been asked here but there is no answer yet. Please help!
I'm using Flask python with gunicorn. Exactly following this course on udemy.
Figured that this error is unpredictable. Its a problem with virtualbox used by Docker. The simplest workaround i found was to run another parallel application which apparently resets virtualbox. Clearing browser cache after doing that solved the problem for me.
While this is just a workaround, if anyone has a clear solution, please share it here.
I had the same problem and solved it using this suggestion by #famelis:
The problem, IMHO, is with the browser. It is using the cache for css and js.
If you are in development environment you can use google chrome and open the programmer's tools (Ctrl+Shift+I)
Then in the Network tab the "Disable cache" must be checked, and this solves the problem.
In production you need to have different paths/names for the files, possibly with version number, for the browser to re-read the files and not use the cache.

Sling Testing Tools Selector configuration

AEM 5.6.1
I am trying to run some server side testing using the sling testing tools. I have deployed the junit.core bundle and I can navigate to the JUnitServlet at /system/sling/junit/
When I hit this url there are tests visible from multiple bundles, I don't want to run the adobe ones but I can't figure out how to filter package names past the period using the url.
e.g
Available tests:
com.adobe.stuff
com.my.stuff
I tried:
/system/sling/junit/com/ <--works but isn't detailed enough
/system/sling/junit/com.my <-- breaks unsurprisingly
/system/sling/junit/com%2Emy <-- also breaks with 501
Is there an expected way of doing this? I couldn't find any documentation about this and the javadoc didn't really help either.
/system/sling/junit/com.my.html should work - you are right that the /system/sling/junit servlet should make this more explicit. There are examples of running such tests from proxy JUnit tests in the Sling codebase, see SlingServerSideTest for example.

Virtualized Puppet master showing alphanumeric error when trying to load the dashboard

When I try to go to the puppet dashboard it loads up a white page saying
The environment must be purely alphanumeric, not ''
I googled this error a bit but there does not seem to be a finite solution yet. As fast as what I've done I've looked into the conf.d files, but I'm afraid to make the wrong edit. I'm still new to this and was wondering if anyone has ever ran into a similar situation?
This happens if one tries to access puppet console in wrong port (8140) instead of 443, assuming default ports are being used.
This also happens when you install puppet-passenger The opensource.
In this case - everything is OK!
Install Open Source agent and be a Puppet Master :)

ArgumentNullException when initializing site

I am in the process of evaluating several service frameworks and one of them is OpenRasta.
Despite being taken a bit aback for the lack of organization (multiple source code repositories, lack of binary downloads, outdated build instructions and the end result of the build, OpenRasta.dll, has version 0.0.0.0 after building the openrasta-core repository), I managed my way to start building a site with a service that serves a bit of Xml (I did include OpenRasta.Hosting.AspNet and configured the handlers and modules as per IIS or Cassini).
But the very first time I hit the site (both IIS Express and VS Dev Server) I get a ArgumentNullException coming from the PipelineStage.cs. Apparently the pipeline.CallGraph property is null.
My configuration source is a mere:
ResourceSpace.Has
.ResourcesOfType<CatalogCollection>()
.AtUri("/catalogs")
.HandledBy<CatalogsHandler>()
.AsXmlDataContract();
As I mentioned I am using the code I cloned from the openrasta-core repository as of yesterday.
Thanks in advance
try wrapping resource registrations in
using (OpenRastaConfiguration.Manual)
{
//code
}
Also check this out;
https://github.com/openrasta/openrasta-stable/wiki/Building-Your-First-OpenRasta-Website
Hope this helps

Resources