/var/www/BookStack/public/translations.js" failed (2: No such file or directory) #283

Closed
opened 2026-02-04 18:18:02 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @DeviantEng on GitHub (Mar 1, 2017).

  • BookStack Version: Release v0.15.1 (commit 6d92604)
  • PHP Version: 5.6.30 (CentOS 7, IUS Repo)
  • MySQL Version: mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1
  • Web server: nginx + php-fpm

Bookstack installed (manually) and appears to be working, however every time a page is loaded I get an error in my nginx log.

2017/03/01 16:16:42 [error] 1985#0: *62 open() "/var/www/BookStack/public/translations.js" failed (2: No such file or directory), client: 172.16.1.10, server: bookstack, request: "GET /translations.js HTTP/1.1", host: "172.16.1.171", referrer: "http://172.16.1.171/books"

Doesn't matter what page is loaded, an error is written that it's not able to find /var/www/BookStack/public/translations.js, which doesn't exist. Is this supposed to exist here? I don't see it in the repo, so I figure maybe composer or artisan is responsible for generating/copying this file here?

I would be happy to provide any additional info as requested so I can get this resolved. Really looking forward to using BookStack.

Originally created by @DeviantEng on GitHub (Mar 1, 2017). * BookStack Version: Release v0.15.1 (commit 6d92604) * PHP Version: 5.6.30 (CentOS 7, IUS Repo) * MySQL Version: mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1 * Web server: nginx + php-fpm Bookstack installed (manually) and appears to be working, however every time a page is loaded I get an error in my nginx log. ``` 2017/03/01 16:16:42 [error] 1985#0: *62 open() "/var/www/BookStack/public/translations.js" failed (2: No such file or directory), client: 172.16.1.10, server: bookstack, request: "GET /translations.js HTTP/1.1", host: "172.16.1.171", referrer: "http://172.16.1.171/books" ``` Doesn't matter what page is loaded, an error is written that it's not able to find `/var/www/BookStack/public/translations.js`, which doesn't exist. Is this supposed to exist here? I don't see it in the repo, so I figure maybe composer or artisan is responsible for generating/copying this file here? I would be happy to provide any additional info as requested so I can get this resolved. Really looking forward to using BookStack.
OVERLORD added the 🐛 Bug🚀 Priority labels 2026-02-04 18:18:02 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 4, 2017):

Hi @DeviantEng , That file is dynamically generated on the fly by BookStack (It does not exist as a static file). I'd imagine this is something in your Nginx config which means it does not query BookStack if the file is not found.

For further support it would be great if you could post your nginx BookStack config.

@ssddanbrown commented on GitHub (Mar 4, 2017): Hi @DeviantEng , That file is dynamically generated on the fly by BookStack (It does not exist as a static file). I'd imagine this is something in your Nginx config which means it does not query BookStack if the file is not found. For further support it would be great if you could post your nginx BookStack config.
Author
Owner

@DeviantEng commented on GitHub (Mar 4, 2017):

Thanks for the explanation @ssddanbrown. Here is the nginx config I am currently using.

server {
  listen 80;
  server_name localhost;
  root /var/www/BookStack/public;

  access_log  /var/log/nginx/bookstack_access.log;
  error_log  /var/log/nginx/bookstack_error.log;

  client_max_body_size 100m;
  fastcgi_buffers 64 4K;

  index  index.php;

  location / {
    try_files $uri $uri/ /index.php?$query_string;
  }

  location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
    deny all;
  }

  location ~ \.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass unix:/var/run/php-fpm.sock;
  }

  location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
    expires 30d;
    access_log off;
  }
}
@DeviantEng commented on GitHub (Mar 4, 2017): Thanks for the explanation @ssddanbrown. Here is the nginx config I am currently using. ``` server { listen 80; server_name localhost; root /var/www/BookStack/public; access_log /var/log/nginx/bookstack_access.log; error_log /var/log/nginx/bookstack_error.log; client_max_body_size 100m; fastcgi_buffers 64 4K; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) { deny all; } location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass unix:/var/run/php-fpm.sock; } location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { expires 30d; access_log off; } } ```
Author
Owner

@ssddanbrown commented on GitHub (Mar 4, 2017):

@DeviantEng I see the isuse. The last location block is effectively eating up requests to all JS files which include this dynamic one.

To get around this you can add try_files $uri $uri/ /index.php?$query_string; to that last location block or remove js from the list of extensions.

Looking at this I think it may be wise for BookStack to serve these translations on a endpoint without an extension so that people can set up separate cache rules for js files as you have done.

I'll keep this open and make that change for the next version of BookStack (Might do a quick point release tomorrow) otherwise, until then, you can use the above workaround if you need full multi-lingual support or no errors in your log.

@ssddanbrown commented on GitHub (Mar 4, 2017): @DeviantEng I see the isuse. The last location block is effectively eating up requests to all JS files which include this dynamic one. To get around this you can add `try_files $uri $uri/ /index.php?$query_string;` to that last location block or remove `js` from the list of extensions. Looking at this I think it may be wise for BookStack to serve these translations on a endpoint without an extension so that people can set up separate cache rules for js files as you have done. I'll keep this open and make that change for the next version of BookStack (Might do a quick point release tomorrow) otherwise, until then, you can use the above workaround if you need full multi-lingual support or no errors in your log.
Author
Owner

@DeviantEng commented on GitHub (Mar 4, 2017):

Thanks @ssddanbrown.

I completely forgot that I had js (as well as css) in that last location, so bad on me. But interesting to hear that you may change this behavior. I believe I'll leave my config as is for now, since I don't need multi-lingual support and the errors I can over look for now.

Thanks for the quick turnaround!

@DeviantEng commented on GitHub (Mar 4, 2017): Thanks @ssddanbrown. I completely forgot that I had js (as well as css) in that last location, so bad on me. But interesting to hear that you may change this behavior. I believe I'll leave my config as is for now, since I don't need multi-lingual support and the errors I can over look for now. Thanks for the quick turnaround!
Author
Owner

@DeviantEng commented on GitHub (Mar 5, 2017):

Tested; confirmed I no longer get those error messages.

Thanks!

@DeviantEng commented on GitHub (Mar 5, 2017): Tested; confirmed I no longer get those error messages. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#283