Phabricator can't upload some files on specific PCs - upload

Installation: OS Debian 8.6 Jessie
Phabricator version:
phabricator 62cf4e6b95abbebc8ae2b1591039967651188c6e (Sat, Jan 14)
arcanist ade25facfdf22aed1c1e20fed3e58e60c0be3c2b (Fri, Jan 6)
phutil 9d85dfab0f532d50c2343719e92d574a4827341b (Fri, Jan 13)
MySQL: mysql Ver 14.14 Distrib 5.5.53, for debian-linux-gnu (x86_64) using readline 6.3
Apache2:
Server version: Apache/2.4.10 (Debian)
Server built: Sep 15 2016 20:44:43
Server's Module Magic Number: 20120211:37
Server loaded: APR 1.5.1, APR-UTIL 1.5.4
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
Storage is configured MySQL (storage.mysql-engine.max-size = 8388608) and localdisk (storage.local-disk.path is set).
Phabricator is setup like vhost with next config:
<VirtualHost *:80>
ServerName phabricator.domain.com
ServerAlias phab.domain.org
DocumentRoot /home/repo/phabricator/phabricator/webroot/
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
ErrorLog /var/log/apache2/phabricator-error.log
CustomLog /var/log/apache2/phabricator-access.log common
<Directory "/home/repo/phabricator/phabricator/webroot">
Require all granted
</Directory>
</VirtualHost>
The bug:
After almost 2 year work with that installation of Phab we started to experience file upload problems. 5 users reported sporadically stalled upload files on 15-20-25% and freez. Network access to server is stalled. Must reset connection.
2 of users always have a problem with upload (Nor drag-and-drop way nor upload form). That appear in task edit and in File module. Testet with all available browsers - IE11, Chrome, Firefox.
Network recovers only by reset (enable/disable) of network adapter to brings back the network connection.
The size of files is from 500K to 2.5Mb. I thought is not a size critical - next time same file can be uploaded for few seconds.
The problem files on neighbour PC, same network, uploads fast and OK!
Apache2 logs and Phabricator logs not report any errors which is strange.
All recommended settings in apache2 conf and PHP values are setup to the highest possible timeout or files/upload size.
If it's needed more info/actions/logs can provide.

Resolved: Change in PHP upload size and permit Phabricator's URLs in enterprize AV

Related

Does Puppet Dashboard work in Ruby Passenger 5?

Has anyone encountered problem of running Puppet Dashboard on Ruby Passenger 5? If yes does it really work with that Passenger version?
I've already setup and configured the necessary files required to run Puppet Dashboard via Passenger. Currently, the Apache test page is shown instead of the dashboard menu. This will not appear if Puppet-Dashboard is run in the lightweight Webrick server.
While scouring most of the installation samples and the manuals on how to install and configure it for Centos 6. I've seen most of them were based on Passenger 3 / 4. I am currently using 5.0.10 as it is used in conjunction with Puppet 3.8.1. One thing certain is that RailsAutoDetect is deprecated in version 5 and that has been commented out.
Below my puppet-dashboard.conf file (the load module has been moved to another file to avoid double-instantiation)
On the logs, the first error reported is that the path of /usr/share/puppet-dashboard/public/reports/upload is not there, so I've created those sub-folders to see if what would be the next error.
The next error in the log file after that is now shown like:
Attempt to serve directory: /usr/share/puppet-dashboard/public/reports/upload/
External node and node terminus option has been commented out as not to disrupt normal puppet run-interval activities during office hours.
PassengerHighPerformance on
PassengerMaxPoolSize 6
PassengerPoolIdleTime 1500
PassengerStatThrottleRate 120
Listen 3000
<VirtualHost *:3000>
ServerName mi-cloud-mgmt-config-01
ServerAlias mi-cloud-mgmt-config-01.mimos.local
RailsBaseURI /
PassengerAppRoot /usr/share/puppet-dashboard/
DocumentRoot /usr/share/puppet-dashboard/public/
# UPDATE THIS TO YOUR FQDN
<Directory /usr/share/puppet-dashboard/public/>
Options None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/dashboard_error.log
LogLevel debug
CustomLog /var/log/httpd/dashboard_access.log combined
ServerSignature Off
</VirtualHost>
Yes I have encountered the same issue. I tried to be clever and use the latest passenger for my Puppet Master as per the Puppet guide... https://docs.puppetlabs.com/guides/passenger.html#install-rackpassenger
But it looks like Dashboard doesn't support Passenger 5.x. Which is fair enough considering Dashboard is basically dead.
I noticed the structure of the directories under the <DocumentRoot> and <Directory> were different for Dashboard compared to Puppet Master, namely no config.ru being present.
So on CentOS 6 I tried the version of mod_passenger from EPEL repo mod_passenger-3.0.21-11.el6 and that worked for both Puppet Master and Dashboard.
According to some knowledgeable folks in #puppet IRC there should only be a minor lowering in performance with 3.x compared to 5.x.
Although it might need some tweaking it does work on passenger 5.
I use Nginx but if it works using Nginx it should on apache as well.
I use passenger-5.0.13 with ruby 1.9.1 to run puppet dashboard.

I'm getting 403 error using passenger for rails in apache

I've already installed the needed tools, and followed several tutorials trying to make passenger respond.
I can access static files in public folder (public/500.html or 422.hml). Yesterday I entered through a vhost, and found some passenger errors. But some time later the hosting restarted the service, and since then I have not been able to access the rails app again.
link
link
link
These are some of the links I used to configure the server. I've also read that could be a permission issue; I've checked that, but I'm not sure it's fine.
First of all check your error log. By default, it placed at /var/log/apache2/.
If you have client denied by server configuration issue, check your site conf file at /etc/apache2/sites-available/your-site.conf. It must be in compliance with Phusion Passenger User Guide. Take a look on Require all granted.
<Directory "/home/user/folder">
Require all granted
Options FollowSymLinks
# This relaxes Apache security settings.
AllowOverride None
# MultiViews must be turned off.
Order allow,deny
Allow from all
</Directory>
OK for me this meant I was running rails 2.3 and using Phusion Passenger 5.x
Apparently 5.x doesn't work with 2.2 at all, and with 2.3 requires you to copy in a config.ru file first (so that rails will use rack for the backend).
example config.ru file for 2.3:
# Rack Dispatcher
# Require your environment file to bootstrap Rails
require File.dirname(__FILE__) + '/config/environment'
# Dispatch the request
run ActionController::Dispatcher.new
I could not figure out why no incantations seemed to work, it was like Passenger was ignoring my rails app.
In my /var/log/apache2/error.log file, I had this:
[Mon May 11 15:47:00.397891 2015] [autoindex:error] [pid 17490:tid 3058694976] [client 216.49.181.251:49248] AH01276: Cannot serve directory /home/x/y/railsapp/public/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive, referer: https://www.google.com/
Which confused the heck out of me an apparently meant "passenger isn't running on that virtual host".
If I created a public/index.html file, apache served that fine so it wasn't a permissions issue.
I also saw this, which meant passenger was starting up ok:
[ 2015-05-11 18:23:53.9594 4964/b7415700 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
See also https://www.phusionpassenger.com/documentation/Users%20guide%20Apache%204.0.html#_i_get_a_403_forbidden_error
So basically with passenger 5.x (in the release notes it says that rails 2.2 isn't supported, 2.3 is only supported if you create a "config.ru" file in the root of your rails app. It works with old versions of rack like rails 2.3 requires, just remove your newer rack gem and install 1.1.6 or what not, remove vendored rack gems if any. GL!
Also as a side note, this message:
[Mon May 11 18:25:10.235574 2015] [core:alert] [pid 5263:tid 3017780032] [client 127.0.0.1:56737] /home/rdp/dev/prod_flds/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
meant "remove your public/.htaccess file it's not needed typically by passenger"
I also got an 403 error using passenger for rails in apache on my Mac OS 10.9 (an Unix-like system).
Here's some tips:
You can check apache log directory and see the what happened.
The directory: /var/log/apache2/error_log.
Issue: Permission denied: access to / denied ( filesystem path 'path_apache_access' ) because search permissions are missing on a component of the path.
Check 'path_apache_access' by CLI: ls -ld 'path_apache_access' and use chmod +x to change the path privilege.
Also, note this: Httpd Wiki - (13) Permission Denied-.
Issue: configuration error: couldn't perform authentication. AuthType not set!.
Issue: client denied by server configuration.
Go to /etc/apache2/httpd.conf and take a look on <Directory> tag.
Check apache version by CLI: apachectl -v, if Apache < 2.4, do NOT uncomment "Require all granted".
<Directory "rails_app_directory/public">
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
# Require all granted
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
Answer was that passenger gave me 403 because i had to set environment variable "RackEnv" on apache configuration to "development" (on my case).

Deploying RoR app with Passenger: Apache shows files only from public folder

I am a newbie in both Rails and Apache stuff. I followed tutorials to create new rails app, and tried to deploy it using Passenger.
I generated a scaffold, created+migrated database and, and it is already working on localhost:3000.
I installed apache2 and passenger, enabled mod passenger, and I can see the usual "Welcome aboard/You’re riding Ruby on Rails!" page on localhost:80 also. But I can't reach the localhost/posts page, while I can reach localhost:3000/posts. (I see "500 Internal Server Error" page, not one of the 404/422/500 pages in the public folder). I also don't see the rails image on the index page (assets/rails.png) on port #80 -everything is OK on port #3000.
I added RackEnv developer and RailsEnv developer to the virtual host file. Apache gives no error output on screen when I restart it -It reasonably gives error when I say a2dismod passenger: "Invalid command 'RackEnv'". So I assume passenger is working.
I believe somehow apache is not reading the folders except for the public folder, I tried playing around with the permissions and ownerships with no success.
Anybody has a clue?
Thanks
EDIT: I did
rake db:create RAILS_ENV=production
rake db:migrate:reset RAILS_ENV=production
and the deleted the RackEnv/RailsEnv lines from the vhost file, and restarted apache. Now I see public/500.html on localhost/posts. it is still working on localhost:3000/posts
Logs: rails log file contains only
Migrating to CreateDenemes (20120316021657)
apache error log
[Thu Mar 15 22:22:03 2012] [notice] Digest: generating secret for digest authentication ...
[Thu Mar 15 22:22:03 2012] [notice] Digest: done
[Thu Mar 15 22:22:04 2012] [notice] Apache/2.2.20 (Ubuntu) DAV/2 Phusion_Passenger/3.0.11 mod_ssl/2.2.20 OpenSSL/1.0.0e configured -- resuming normal operation
s
and other_vhosts...log is empty
V host file:
VirtualHost *:80
ServerName sencer
DocumentRoot /home/sselcuk/sencer/public
Directory /home/sselcuk/sencer/public
AllowOverride all
Options -MultiViews
/Directory
/VirtualHost
I need your log files, both Rails and apache log.
Rails log file: see: RAILS_ROOT/log/production.log
apache log file: see /var/log/apache2 ( in ubuntu)
once getting that information, we can debug for you.

Deploying a Rails Application to an LAMP server with Phusion Passenger

I just finished working on my first rails app and am ready to deploy to my VPS. I decided to try using Phusion Passenger and went through the extremely simple install process. I got all the right dependencies, so on that end things seems to be ok. Where I think my problem lies is in the routing and the apache config file.
As told I added the following at the very end of the following file: /etc/apache2/apache2.conf
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.8
PassengerRuby /usr/bin/ruby1.8
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/bl/gfy/public
<Directory /home/bl/gfy/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
When I restart apache I get the following message:
* Restarting web server apache2 [Wed Aug 10 03:16:24 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting [Wed Aug 10 03:16:26 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
When I point my browser to my the IP I set up I get pointed to the sample file that comes with apache instead of to my rails app.
Any ideas would be greatly appreciated.
Thanks.
Somewhat unrelated to your problem, but still.
Both warning you see are not critical and should not affect server operations.
One means that your server hostname is not set, another just reminds you that passenger is already loaded from somewhere, probably after it stumbles upon in /etc/apache/modules.d.
All in all, you don't really want to edit /etc/apache/apache2.conf. Instead use existing structures, like /etc/apache2/sites-available etc.
Now back to your problem.
Your VirtualHost is most likely being overriden by default host.
Executing sudo a2dissite default in your shell will disable it. Assuming you don't have some exotic LAMP flavor.

Trying to run Rails App with Apache/Passenger, but getting 404s

I've installed passenger (don't know if the installation is correct) onto apache (i'm just using a development macintosh running snow leopard).
the httpd.conf file has a VirtualHost setting like this
<VirtualHost *:80>
ServerName myapp
DocumentRoot /webapps/boom/public
<Directory /webapps/boom/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
again, not sure if this is correct.
I can start up apache using apachectl start
and i can pull up the main page using this link (http://localhost).
However, when I try and go to one of my controller pages (I have a controller named blocks_controller.rb), I get a 404 error (http://localhost/blocks).
The apache error_log file shows => [Wed Jul 07 15:25:46 2010] [error] [client 127.0.0.1] File does not exist: /webapps/boom/public/blocks
I think this is something pretty simple that I'm doing wrong, but I don't know what.
Any thoughts??
Thanks!
Looks to me like Apache is not picking up the virtual host configuration so Passenger isn't in the loop. Are you sure that's all working? Apache looks a bit different in different environments so look in your OS specific locations at the Apache log files to be sure.

Resources