intranet-dev CSS compiler broken

RESOLVED FIXED

Status

mozilla.org Graveyard
Server Operations
--
minor
RESOLVED FIXED
6 years ago
3 years ago

People

(Reporter: ozten, Assigned: jd)

Tracking

Details

(Whiteboard: [qa?], URL)

(Reporter)

Description

6 years ago
Looks like node can't read static/css/

Steps to repro:
curl https://intranet-dev.allizom.org/browserid/css/stylo.css

Output: Error: EACCES, open '../static/css/stylo.css'

What is going on?
We use the less CSS compiler to compile stylo.css on demand. I just noticed that this is broken in dev, since we've moved everything under the /browserid prefix.

Can we check file and directory permissions.
less will compile static/css/stylo.less into static/css/stylo.css
(Reporter)

Updated

6 years ago
Blocks: 729749

Updated

6 years ago
Assignee: server-ops → jcrowe
Should be able to fix in puppet, see modules/webapp/manifests/admin/bedrock.pp 

    package {
        [
            "mysql",
            "Jinja2",
            "MySQL-python",
            "py-bcrypt",
            "php",
            "php-xml",
            "nodejs-less",
        ]:
            ensure => present;
    }

    package {
      [
        "node-lessjs",
      ]:
        ensure => absent;
    }
(Assignee)

Comment 2

6 years ago
(In reply to Austin King [:ozten] from comment #0)
> Looks like node can't read static/css/
> 
> Steps to repro:
> curl https://intranet-dev.allizom.org/browserid/css/stylo.css
> 
> Output: Error: EACCES, open '../static/css/stylo.css'
> 
> What is going on?
> We use the less CSS compiler to compile stylo.css on demand. I just noticed
> that this is broken in dev, since we've moved everything under the
> /browserid prefix.
> 
> Can we check file and directory permissions.
> less will compile static/css/stylo.less into static/css/stylo.css

Okay, well this is set up quite differently than what I am used to seeing around here, however after quite a lot of digging I think I might be on the right path.

I chown apache;apache all the stuff in and the css directory.  I pushed this out and even restarted apache with no success (still getting error).  There is nothing reporting to the apache error logs, the access log shows my hit (or miss rather):

10.20.81.200 - - [16/May/2012:15:00:35 -0700] "GET /browserid/css/stylo.css HTTP/1.1" 500 45 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"

On the web node I checked permissions on your lessc command:
 ls -al /data/www/intranet.mozilla.org/browserid/node_modules/less/bin/lessc 
-rwxr-xr-x 1 root root 3392 Jan 25 11:00 /data/www/intranet.mozilla.org/browserid/node_modules/less/bin/lessc

So that looks good.  Not sure what to check from here without further information, I mean I see the curl command trying to access this css file but the css file has not been generated.  You say it is generated at run time (on demand) but I don't know what exactly that means (exactly how lessc is called when I try to load the css file directly).

Basically I need more information to troubleshoot this further.

Thanks
Status: NEW → ASSIGNED
(Reporter)

Comment 3

6 years ago
To simulate the node process:

cd $path_to_code/server
../node_modules/.bin/lessc ../static/css/404.less > ../static/css/404.css
../node_modules/.bin/lessc ../static/css/stylo.less > ../static/css/stylo.css

or
../node_modules/.bin/lessc ../static/css/404.less
../node_modules/.bin/lessc ../static/css/stylo.less
to see if lessc works

Paths are important... node process runs with server as the current working directory.
(Assignee)

Comment 4

6 years ago
When I follow your instructions on the dev web server everything works.  I su to the apache user cd to the code_dir/server, execute command, works.  Execute with redirected output (> static/css/file.css), works.  After I run the curl command locally and it works (I get the css file).

FYI I removed the test file I had generated.

As far as I am able to determine everything is working correctly.  Can you tell me the exact steps you use to generate these files.  Not what you gave me but there must be something which triggers the commands you gave me, a web page or API or deployment script or whatnot.  My only guess at the moment is that there may be a $PATH issue, but I am not able to test this without additional information.  One thing I know is that just viewing these files with curl through apache is not going to trigger any sort of command (As far as i can tell by looking at the configs), hence the 500 error.
(Assignee)

Comment 5

6 years ago
Austin,

Any update here?  Just checking if you can provide the information I need to troubleshoot this further.

Regards
(Reporter)

Comment 6

6 years ago
I checked in the CSS files, so they can be served up, instead of using lessc.

I'm still seeing

    Error: EACCES, open '../static/css/stylo.css'

Committed in
https://github.com/mozilla/vinz-clortho/commit/88bcde9d17c81e123806dbcfc5441d44bc19d914
(Reporter)

Comment 7

6 years ago
Nevermind, took a few to deploy, I guess.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [qa?]
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.