Skip to content
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

Will not start : ENOENT: no such file or directory, open '/opt/nodebb/public/stylesheet.css' #5368

Closed
kakious opened this issue Jan 14, 2017 · 37 comments
Assignees
Labels
Milestone

Comments

@kakious
Copy link

kakious commented Jan 14, 2017

git hash : b1b9174

db version v3.2.11
git version: 009580ad490190ba33d1c6253ebd8d91808923e4
OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1604
distarch: x86_64
target_arch: x86_64

database:mongo db

Steps used to cause this:
Followed this walkthrough step by step
https://nodebb.readthedocs.io/en/latest/installing/os/ubuntu.html

LOG:
Clustering enabled: Spinning up 1 process(es).

14/1 22:55:45 [10338] - info: Time: Sat Jan 14 2017 22:55:45 GMT+0000 (UTC)
14/1 22:55:45 [10338] - info: Initializing NodeBB v1.4.2
14/1 22:55:47 [10338] - info: initializing NodeBB ...
14/1 22:55:47 [10338] - info: Routes added
14/1 22:55:47 [10338] - error: Error: ENOENT: no such file or directory, open '/opt/nodebb/public/stylesheet.css'
at Error (native)
[cluster] Child Process (10338) has exited (code: 0, signal: null)
Thank you!

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

can you try ls public?

@kakious
Copy link
Author

kakious commented Jan 14, 2017

503.html favicon.ico js-enabled.css less nodebb.min.js uploads
acp.min.js images language logo.png src vendor

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

try running ./nodebb build then ./nodebb dev

@kakious
Copy link
Author

kakious commented Jan 14, 2017

./nodebb build
`14/1 23:19:59 [10468] - info: [build] Building javascript
14/1 23:19:59 [10468] - info: [build] Building client-side CSS
14/1 23:20:03 [10468] - info: [build] js => Completed in 3.697s
(node:10468) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Broken @import declaration of "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" - timeout'

./nodebb dev
`
events.js:160
throw er; // Unhandled 'error' event
^

Error: EACCES: permission denied, open '/opt/nodebb/logs/output.log'
at Error (native)`

@kakious
Copy link
Author

kakious commented Jan 14, 2017

Running it as sudo

NodeBB v1.4.2 Copyright (C) 2013-2014 NodeBB Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
For the full license, please visit: http://www.gnu.org/copyleft/gpl.html

Clustering enabled: Spinning up 1 process(es).

14/1 23:22:19 [10533] - verbose: * using configuration stored in: /opt/nodebb/config.json
14/1 23:22:19 [10533] - info: Time: Sat Jan 14 2017 23:22:19 GMT+0000 (UTC)
14/1 23:22:19 [10533] - info: Initializing NodeBB v1.4.2
14/1 23:22:19 [10533] - verbose: * using mongo store at 127.0.0.1:27017
14/1 23:22:19 [10533] - verbose: * using themes stored in: /opt/nodebb/node_modules
14/1 23:22:20 [10533] - verbose: Checking dependencies for outdated modules
14/1 23:22:21 [10533] - verbose: [notifications.init] Registering jobs.
14/1 23:22:21 [10533] - verbose: [user/jobs] (Re-)starting user jobs...
14/1 23:22:21 [10533] - verbose: [user/jobs] 0 jobs terminated
14/1 23:22:21 [10533] - verbose: [user/jobs] Starting job (digest.daily)
14/1 23:22:21 [10533] - verbose: [user/jobs] Starting job (digest.weekly)
14/1 23:22:21 [10533] - verbose: [user/jobs] Starting job (digest.monthly)
14/1 23:22:21 [10533] - verbose: [user/jobs] Starting job (reset.clean)
14/1 23:22:21 [10533] - verbose: [user/jobs] 4 jobs started
14/1 23:22:21 [10533] - info: initializing NodeBB ...
14/1 23:22:21 [10533] - info: [themes] Using theme nodebb-theme-persona
14/1 23:22:21 [10533] - verbose: [plugins] Initializing plugins system
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-composer-default
14/1 23:22:21 [10533] - verbose: [plugins] Found 2 js file(s) for plugin nodebb-plugin-composer-default
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-plugin-composer-default/static/lib/client.js
14/1 23:22:21 [10533] - verbose: [plugins/load] File not found: /opt/nodebb/node_modules/nodebb-plugin-composer-default/node_modules/screenfull/dist/screenfull.js (Ascending)
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/screenfull/dist/screenfull.js
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 ACP js file(s) for plugin nodebb-plugin-composer-default
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-plugin-composer-default/static/lib/admin.js
14/1 23:22:21 [10533] - verbose: [plugins] Found 10 AMD-style module(s) for plugin nodebb-plugin-composer-default
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-plugin-composer-default
14/1 23:22:21 [10533] - verbose: [plugins] Found 6 js file(s) for plugin nodebb-theme-persona
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/persona.js
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/modules/nprogress.js
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/modules/autohidingnavbar.min.js
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/modules/slideout.min.js
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/modules/quickreply.js
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/client/chats.js
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 ACP js file(s) for plugin nodebb-theme-persona
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-theme-persona/lib/admin.js
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-theme-persona
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-markdown
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-markdown
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-plugin-markdown/public/js/client.js
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 ACP js file(s) for plugin nodebb-plugin-markdown
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-plugin-markdown/public/js/admin.js
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 AMD-style module(s) for plugin nodebb-plugin-markdown
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-plugin-markdown
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-mentions
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-mentions
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-plugin-mentions/static/autofill.js
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-plugin-mentions
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 css file(s) for plugin nodebb-widget-essentials
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-widget-essentials
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-rewards-essentials
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-rewards-essentials/static/lib/main.js
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-rewards-essentials
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-plugin-soundpack-default
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-emoji-extended
14/1 23:22:21 [10533] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-emoji-extended
14/1 23:22:21 [10533] - verbose: [plugins/load] File found: /opt/nodebb/node_modules/nodebb-plugin-emoji-extended/public/scripts/
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-plugin-emoji-extended
14/1 23:22:21 [10533] - verbose: [plugins] Loaded plugin: nodebb-plugin-emoji-one
14/1 23:22:21 [10533] - info: [plugins] Plugins OK
14/1 23:22:21 [10533] - verbose: [meta/js] 15 of 15 modules bridged
14/1 23:22:21 [10533] - verbose: [hotswap] Router with id plugins replaced successfully
14/1 23:22:21 [10533] - verbose: [plugins] All plugins reloaded and rerouted
14/1 23:22:21 [10533] - verbose: [hotswap] Router with id auth replaced successfully
14/1 23:22:21 [10533] - info: Routes added
14/1 23:22:21 [10533] - verbose: [meta/css] Reading stylesheet stylesheet.css from file
14/1 23:22:21 [10533] - error: Error: ENOENT: no such file or directory, open '/opt/nodebb/public/stylesheet.css'
at Error (native)
[cluster] Child Process (10533) has exited (code: 0, signal: null)

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

./nodebb build failed which is what caused that first error you reported. For some reason NodeBB can't access https://fonts.googleapis.com/css?family=Roboto:300,400,500,700 so the build step fails.

@kakious
Copy link
Author

kakious commented Jan 14, 2017

Odd

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Also, it seems that the directory that NodeBB is in does not belong to the user you're attempting to run it as. That causes the EACCESS error. Try changing the rights to the directory so you can run it without root.

@kakious
Copy link
Author

kakious commented Jan 14, 2017

changed

@kakious
Copy link
Author

kakious commented Jan 14, 2017

changed and it can ping google.com and fonts.google.com

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Ok. Is ./nodebb build still failing?

@kakious
Copy link
Author

kakious commented Jan 14, 2017

yes

14/1 23:28:45 [10618] - info: [build] Building javascript
14/1 23:28:45 [10618] - info: [build] Building client-side CSS
14/1 23:28:49 [10618] - info: [build] js => Completed in 3.708s
(node:10618) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Broken @import declaration of "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" - timeout

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Can you try curl "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" > font.css in the nodebb/public directory?

@kakious
Copy link
Author

kakious commented Jan 14, 2017

root@nodebb:/opt/nodebb/public# curl "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" > font.css
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 963 0 963 0 0 167 0 --:--:-- 0:00:05 --:--:-- 226

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Did it finish? Any errors?

@kakious
Copy link
Author

kakious commented Jan 14, 2017

while running build again.

root@nodebb:/opt/nodebb# ./nodebb build
14/1 23:35:15 [10669] - info: [build] Building javascript
14/1 23:35:15 [10669] - info: [build] Building client-side CSS
14/1 23:35:21 [10669] - info: [build] js => Completed in 6.446s
(node:10669) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Broken @import declaration of "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" - timeout

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Looks like you're having this issue: clean-css/clean-css#612

Can you try running NODE_ENV=development&& ./nodebb build?

@kakious
Copy link
Author

kakious commented Jan 14, 2017

root@nodebb:/opt/nodebb# NODE_ENV=development&& ./nodebb build
14/1 23:39:41 [10708] - info: [build] Building javascript
14/1 23:39:41 [10708] - info: [build] Building client-side CSS
14/1 23:39:48 [10708] - info: [build] js => Completed in 6.508s
(node:10708) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Broken @import declaration of "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" - timeout

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Never mind, that wouldn't change anything. The culprit seems to be a proxy issue which causes cleanCSS to fail here. You can try removing the clean() from that line in your local install, but that will lead to less minification in your CSS. You can also try replacing clean() with something like:

clean({
  inliner: {
    request: {
      hostname: "137.85.51.246",   // proxy
      port: 8080,
      path: "http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700",
      headers: {
        Host: "fonts.googleapis.com"
      }
    }
  }
})

@pitaj
Copy link
Contributor

pitaj commented Jan 14, 2017

Please try removing it and rerunning ./nodebb build before trying the configuration option there.

@kakious
Copy link
Author

kakious commented Jan 15, 2017

root@nodebb:/opt/nodebb# cat nodebb | grep clean
root@nodebb:/opt/nodebb#

@kakious
Copy link
Author

kakious commented Jan 15, 2017

Clean does not exist.

@pitaj
Copy link
Contributor

pitaj commented Jan 15, 2017

Did you see the file I linked? The code is in nodebb/src/meta/css.js

@kakious
Copy link
Author

kakious commented Jan 15, 2017

kakious@nodebb:/opt/nodebb$ sudo ./nodebb build
15/1 03:36:25 [10868] - info: [build] Building javascript
15/1 03:36:25 [10868] - info: [build] Building client-side CSS
15/1 03:36:27 [10868] - info: [build] clientCSS => Completed in 2.094s
15/1 03:36:27 [10868] - info: [build] Building admin control panel CSS
15/1 03:36:28 [10868] - info: [build] acpCSS => Completed in 1.368s
15/1 03:36:28 [10868] - info: [build] Building templates
15/1 03:36:28 [10868] - info: [build] tpl => Completed in 0.121s
15/1 03:36:31 [10868] - info: [build] js => Completed in 6.519s
15/1 03:36:31 [10868] - info: [build] Asset compilation successful. Completed in 7.703s.

@kakious
Copy link
Author

kakious commented Jan 15, 2017

It's up and running properly!

@pitaj
Copy link
Contributor

pitaj commented Jan 15, 2017

Great! Now we're just waiting on clean-css/clean-css#612

@kakious
Copy link
Author

kakious commented Jan 15, 2017

what do you mean?

@pitaj
Copy link
Contributor

pitaj commented Jan 15, 2017

Well, the root of the issue is caused by cleanCSS not properly using the system proxy settings when requesting HTTPS routes. So now we're just waiting on that issue to be solved before closing this tracker.

@julianlam
Copy link
Member

@pitaj ok to keep this badge, but it's not a showstopper... if it only affects users behind some sort of proxy (which admittedly is not that many...)

@julianlam julianlam added this to the 1.5.0 milestone Jan 19, 2017
@julianlam
Copy link
Member

Looks like upstream wants a new issue made for tracking purposes @pitaj

@pitaj
Copy link
Contributor

pitaj commented Jan 21, 2017

Hi, @vtrenten. I'm finding this difficult to reproduce on my own system because I don't have a proxy. Can you try something for me?

  1. Undo that change to the src/meta/css.js file
  2. Go to node_modules/nodebb-theme-persona/less/style.less and change the top line
    from this:
    @import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700);
    to this:
    @import (inline) url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700);
  3. Try running ./nodebb build again and see if that error occurs.

@pitaj
Copy link
Contributor

pitaj commented Jan 21, 2017

We could also configure clean-css to not inline remote imports at all by doing this:

clean({
  processImportFrom: ['local']
})

@k2ly2n
Copy link

k2ly2n commented Feb 16, 2017

hello, @pitaj ,
I got the same issue while upgrading from version 1.3.0 to 1.4.3
I don't have proxy but don't know why I got this error.
So I followed the steps you mentioned above with file node_modules/nodebb-theme-persona/less/style.less and ran ./nodebb upgrade
that error gone but got the same error after completing few stages

[root@linux nodebb]# ./nodebb upgrade

  1. Bringing base dependencies up to date... OK
  2. Checking installed plugins for updates... OK
  3. Updating NodeBB data store schema...
    16/2 11:52:53 [30794] - info: Beginning database schema update
    16/2 11:52:53 [30794] - info: [2016/09/22] Setting category recent tids - skipped!
    16/2 11:52:53 [30794] - info: [2016/10/8] favourite -> bookmark refactor - skipped!
    16/2 11:52:53 [30794] - info: [2016/10/14] Creating sorted sets for post replies - skipped!
    16/2 11:52:53 [30794] - info: [2016/11/22] Update global and user language keys - skipped!
    16/2 11:52:53 [30794] - info: [2016/11/25] Creating sorted sets for pinned topics - skipped!
    16/2 11:52:53 [30794] - info: [upgrade] Schema already up to date!
    16/2 11:52:53 [30794] - info: [build] Building javascript
    16/2 11:52:53 [30794] - info: [build] Building client-side CSS
    16/2 11:53:01 [30794] - info: [build] js => Completed in 7.928s
    16/2 11:53:05 [30794] - info: [build] clientCSS => Completed in 12.038s
    16/2 11:53:05 [30794] - info: [build] Building admin control panel CSS
    (node:30794) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Broken @import declaration of "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" - timeout

I think I need to do the same in some other file also. Can you please help. TIA

@pitaj
Copy link
Contributor

pitaj commented Feb 16, 2017

Have you tried replacing clean() with

clean({
  processImportFrom: ['local']
})

In src/meta/css.js?

You should be able to test if it works by only running ./nodebb build css.

I'm not sure what exactly you did. You you tell me the exact changes you made? Thanks.

@k2ly2n
Copy link

k2ly2n commented Feb 16, 2017

@pitaj
I just replaced clean() as you said above and it worked now. thank you very much.

Earlier I did the below but got error in different stage

Go to node_modules/nodebb-theme-persona/less/style.less and change the top line
from this:
@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700);
to this:
@import (inline) url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700);

@pitaj
Copy link
Contributor

pitaj commented Feb 16, 2017

Ok, cool. I might just make that change in core. I don't see any updates on the upstream issue, so it'll be the best way to fix this.

@julianlam
Copy link
Member

Thanks @pitaj

@julianlam julianlam added the bug label Feb 17, 2017
@julianlam julianlam modified the milestones: 1.5.0, 1.4.4 Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants