CkFtp PutTree not working with UNC pathes any more - chilkat

With Chilkat-Library starting version 9.5.0.76 the function PutTree of CkFtp2 did not work with UNC-paths any more. It tries to change the remotedir like the local UNC-path.
Code sample:
CkFtp2 ftp;
ftp.put_Hostname("ftp.example.com");
ftp.put_Username("test");
ftp.put_Password("test");
bool success = ftp.Connect();
success = ftp.ChangeRemoteDir("/");
success = ftp.PutTree("\\\\server\\daten\\Ent\\Seb\\Versionssystem");
success = ftp.Disconnect();
Chilkat-Log:
PutTree:
DllDate: Feb 24 2020
ChilkatVersion: 9.5.0.82
UnlockPrefix: xxxxx
Architecture: Little Endian; 32-bit
Language: Visual C++ 2017 (32-bit)
VerboseLogging: 1
putTree2:
localRootDir: \\server\daten\Ent\Seb\Versionssystem
ProgressMonitoring:
enabled: no
heartbeatMs: 0
sendBufferSize: 65536
(leaveContext 32ms)
mode 0: Upload all files.
PlanOnly: 0
Mode: 0
PreviewOnly: 0
RecursiveDescend: 1
autoGetSizeForProgress: False
rootDir: //server/daten/Ent/Seb/Versionssystem/
pwd:
simpleCommand:
sendCommand:
prepControlChannel:
(leaveContext 15ms)
sendingCommand: PWD
(leaveContext 15ms)
readCommandResponse:
replyLineQP: 257 "/" is your current location
(leaveContext 16ms)
(leaveContext 31ms)
(leaveContext 62ms)
remoteBaseDir: /
initialCurrentRemoteDir: /
changeRemoteDir:
simplePathCommand:
simpleCommand:
sendCommand:
prepControlChannel:
(leaveContext)
sendingCommand: CWD /server/daten/Ent/Seb/Versionssystem
(leaveContext 16ms)
readCommandResponse:
replyLineQP: 550 Can't change directory to /server/daten/Ent/Seb/Versionssystem: No such file or directory
(leaveContext 16ms)
(leaveContext 47ms)
Simple path command failed.
statusCode: 550
reply: 550 Can't change directory to /server/daten/Ent/Seb/Versionssystem: No such file or directory
Do not use the leading forward slash.
Retrying without forward slash.
simpleCommand:
sendCommand:
prepControlChannel:
(leaveContext)
sendingCommand: CWD server/daten/Ent/Seb/Versionssystem
(leaveContext 31ms)
readCommandResponse:
replyLineQP: 550 Can't change directory to server/daten/Ent/Seb/Versionssystem: No such file or directory
(leaveContext 125ms)
(leaveContext 156ms)
Simple path command failed.
statusCode: 550
reply: 550 Can't change directory to server/daten/Ent/Seb/Versionssystem: No such file or directory
(leaveContext 250ms)
(leaveContext 282ms)
ChangeRemoteDir failed (2)
dir: /server/daten/Ent/Seb/Versionssystem
pwd:
simpleCommand:
sendCommand:
prepControlChannel:
(leaveContext)
sendingCommand: PWD
(leaveContext 16ms)
readCommandResponse:
replyLineQP: 257 "/" is your current location
(leaveContext 15ms)
(leaveContext 63ms)
(leaveContext 63ms)
currentRemoteDir: /
originalDir: /
changeRemoteDir:
simplePathCommand:
simpleCommand:
sendCommand:
prepControlChannel:
(leaveContext)
sendingCommand: CWD /
(leaveContext 16ms)
readCommandResponse:
replyLineQP: 250 OK. Current directory is /
(leaveContext 15ms)
(leaveContext 47ms)
(leaveContext 63ms)
(leaveContext 63ms)
(leaveContext 563ms)
Failed.
(leaveContext 610ms)
Until version 9.5.0.75 this code works fine.
Is this a bug or did I am missing a new flag/option to set the behaviour to the old one?

I ran into this same error on 9.5.0.82. It turned out that the change to root
ftp.ChangeRemoteDir("/") was the culprit. The account we had did not have permissions to root.
The ChangeRemoteDir command didn't error but every request after produced the "Can't change directory to... No such file or directory" error.
The ftp.PutTree command worked after skipping the change to root.

Related

".sock" does not exist error; connect() error

I'm trying to set up my Mezzanine/Django project on a virtual Ubuntu 14.04 box on Linode, but get a "502 Bad Gateway error" when trying to navigate to my site in my browser.
I'm following the instructions here: https://linode.com/docs/web-servers/nginx/deploy-django-applications-using-uwsgi-and-nginx-on-ubuntu-14-04.
I ran git clone in /home/django/, so everything's in a folder named FOLDER.
/home/django/ has these directories: Env/ and FOLDER/.
This should give some idea of what FOLDER/ tree looks like:
FOLDER
- product_blog
-- product_blog
--- settings.py
--- wsgi.py
-- manage.py
In my settings.py, I have:
ALLOWED_HOSTS = ["PUBLIC IP OF MY LINODE UBUNTU INSTANCE HERE"]
wsgi.py has this:
"""
WSGI config for product_blog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from mezzanine.utils.conf import real_project_name
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"%s.settings" % real_project_name("product_blog"))
application = get_wsgi_application()
/etc/uwsgi/sites/product_blog.ini has this:
[uwsgi]
project = product_blog
base = /home/django
chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application
master = true
processes = 2
socket = %(base)/%(project)/%(project).sock
chmod-socket = 664
vacuum = true
/etc/init/uwsgi.conf has this:
description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI=/usr/local/bin/uwsgi
env LOGTO=/var/log/uwsgi.log
exec $UWSGI --master --emperor /etc/uwsgi/sites --die-on-term --uid django --gid www-data --logto $LOGTO
/etc/nginx/sites-available/product_blog has this:
server {
listen 80;
server_name mydomain.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/django/FOLDER;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/django/FOLDER/product_blog/product_blog.sock;
}
}
When I go to the IP address for the Linode box, I see a 502 Bad Gateway error.
/var/log/uwsgi.log has this...
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from product_blog.ini
*** Starting uWSGI 2.0.17 (64bit) on [Sun Apr 22 17:17:56 2018] ***
compiled with version: 4.8.4 on 22 April 2018 19:53:45
os: Linux-4.15.12-x86_64-linode105 #1 SMP Thu Mar 22 02:13:40 UTC 2018
nodename: ubuntu-linode
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /etc/uwsgi/sites
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/django/product_blog
chdir(): No such file or directory [core/uwsgi.c line 2629]
chdir(): No such file or directory [core/uwsgi.c line 1644]
Sun Apr 22 17:17:56 2018 - [emperor] curse the uwsgi instance product_blog.ini (pid: 4238)
Sun Apr 22 17:17:59 2018 - [emperor] removed uwsgi instance product_blog.ini
And /var/log/nginx/error.log has this (identifying info removed):
2018/04/22 17:18:14 [crit] 3953#0: *9 connect() to unix:/home/django/FOLDER/product_blog/product_blog.sock failed (2: No such file or directory) while connecting to upstream, client: 73.49.35.42, server: mydomain.com, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/home/django/FOLDER/product_blog/product_blog.sock:", host: "ADDRESS TO LINODE BOX"
It seems that product_blog.sock is supposed to be somewhere in my directory, but it is not there. How do I fix the 502 error so that I can navigate my browser to the Linode box's address and see a working website?
The socket file is supposed to be created by uWSGI. But the uWSGI log is telling you that it can't start up because it can't cd to the directory you have specified in product_blog.ini, /home/django/product_blog.
I can't tell if FOLDER is a placeholder or not, but in any case you don't seem to have included it in that path. I suppose it should be:
chdir = %(base)/FOLDER/%(project)
...
socket = %(base)/FOLDER/%(project)/%(project).sock

Accessing bin directory through nginx/fpm - php

I have a been using a library called Unoconv. (Please note that in my local ubuntu [virtualbox-homestead], it's working as expected, but not in AWS.)
$unoconv = Unoconv::create([
'unoconv.binaries' => '/usr/bin/unoconv',
]);
This is what I call in php. And I can confirm that /usr/bin/unoconv exists.
The initial error was:
exception: "Unoconv\Exception\RuntimeException"
file : "/usr/bin/unoconv"
First, I though it was permission issue. So I adapted accordingly:
My Homestead permissions: -rwxr-xr-x 1 root root 63243 Aug 18 2015 unoconv
My AWS permissions: -rwxr-xr-x 1 root root 63243 Aug 18 2015 unoconv
Then I changed my AWS group to:
-rwxr-xr-x 1 www-data www-data 63243 Aug 18 2015 /usr/bin/unoconv
Then I tried editing /etc/nginx/fastcgi_params and added this line:
// This existed, so I didn't touch it
fastcgi_param REDIRECT_STATUS 200;
// I added this line
fastcgi_param PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/node/bin
And my nginx looks like this:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
The error has now changed to:
exception: "Unoconv\Exception\RuntimeException"
file: "/var/www/my_proj/vendor/php-unoconv/php-unoconv/src/Unoconv/Unoconv.php"
line: 68
message:"Unoconv failed to transcode file"
The file path is changed.
Finally, I tried removing fastcgi_param REDIRECT_STATUS 200;, but nginx doesn't compile/throws a syntax error.
I am stuck on how to overcome the issue.
Update:
In /etc/init.d/php7.0-fpm, I can see PATH=/sbin:/usr/sbin:/bin:/usr/bin, but I am not sure how to fix this issue. Should I use /bin instead of /usr/bin? If I do, I get an error "Executable not found, proposed : /bin/unoconv"
Or is it permission issue?
try making the binary executable by using
sudo chmod +x /path/to/unoconv
also , 'which unoconv' command will help you to find out the exact path of unoconv bin library.
also here is the link reference for your similar issue post:
https://github.com/alchemy-fr/PHP-Unoconv/issues/5

concourse resource - task output not available to put

How do I put the output of a task into a resource?
- name: build-pkg-rpm
public: true
plan:
- aggregate:
- get: oregano-test-fedora
- get: git-clone-resource
trigger: true
passed: [compile, build-docker-image-fedora]
- task: create-rpm
image: oregano-test-fedora
config:
platform: linux
inputs:
- name: git-clone-resource
outputs:
- name: srpm
path: ../srpm
run:
path: .concourse/fedora/buildrpm.sh
dir: git-clone-resource
- put: srpm
resource: copr-resource
params:
rpmbuild_dir: "srpm/rpmbuild/SRPMS"
chroots: ["mageia-6-x86_64", "mageia-couldron-x86_64", "fedora-rawhide-x86_64", "fedora-25-x86_64"]
enable_net: false
max_n_bytes: 250000000
project_id: 825
regex: ".*oregano-.*\\.src\\.rpm$"
buildrpm.sh
#!/usr/bin/env bash
set -e
set -x
pwd 2>&1
RPMBUILD_DIR="$(pwd)/../srpm/rpmbuild/"
mkdir -p ${RPMBUILD_DIR}/{SOURCES,BUILD,RPMS,SRPMS,SPECS}
# fill all vars of the spec.in
./waf configure rpmspec
cp -v build/rpmspec/oregano.spec ${RPMBUILD_DIR}/SPECS/
# generate the distributable tar
./waf dist
cp -v oregano*.tar.xz ${RPMBUILD_DIR}/SOURCES/
cd ${RPMBUILD_DIR}
rpmbuild \
--define "_topdir %(pwd)" \
--define "_builddir %{_topdir}/BUILD" \
--define "_rpmdir %{_topdir}/RPMS" \
--define "_srcrpmdir %{_topdir}/SRPMS" \
--define "_specdir %{_topdir}/SPECS" \
--define "_sourcedir %{_topdir}/SOURCES" \
-ba SPECS/oregano.spec && echo "RPM was built"
pwd 2>&1
According to
https://github.com/starkandwayne/concourse-tutorial/tree/master/12_publishing_outputs
this should work, yet the directory in the put step is empty.
The documentation https://concourse-ci.org/put-step.html seems to not cover this topic very much.
I see that the files are writte properly:
Wrote: /tmp/build/be0f50d1/srpm/rpmbuild/SRPMS/oregano-0.84.3-1.fc25.src.rpm Wrote: /tmp/build/be0f50d1/srpm/rpmbuild/RPMS/x86_64/oregano-0.84.3-1.fc25.x86_64.rpm Wrote: /tmp/build/be0f50d1/srpm/rpmbuild/RPMS/x86_64/oregano-debuginfo-0.84.3-1.fc25.x86_64.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.6mO3iF
+ umask 022
+ cd /tmp/build/be0f50d1/srpm/rpmbuild/BUILD
+ cd oregano
+ rm -rf /tmp/build/be0f50d1/srpm/rpmbuild/BUILDROOT/oregano-0.84.3-1.fc25.x86_64
+ exit 0
+ echo 'RPM was built' RPM was built RPM was built
+ pwd /tmp/build/be0f50d1/srpm/rpmbuild
But then when it comes to put the task's output, it does not find any files:
base dir: "/tmp/build/put/srpm/rpmbuild/SRPMS"
error: Could not find any matches with that regex
caused by: WalkDir entry is useless
caused by: IO error for operation on /tmp/build/put/srpm/rpmbuild/SRPMS: No such file or directory (os error 2)
caused by: No such file or directory (os error 2)
When I hijack into the containers:
1: build #136, step: create-rpm, type: task
2: build #136, step: srpm, type: put
choose a container: 1
[root#f004c6a0-adee-4735-792f-8e237f645751 be0f50d1]# ls -al
total 0
drwxr-xr-x. 1 root root 44 May 31 11:43 .
drwxr-xr-x. 1 root root 24 May 31 11:43 ..
drwxr-xr-x. 1 root root 598 May 31 11:43 git-clone-resource
drwxr-xr-x. 1 root root 16 May 31 11:43 srpm
[root#f004c6a0-adee-4735-792f-8e237f645751 be0f50d1]# ls -al srpm/rpmbuild/
BUILD/ BUILDROOT/ RPMS/ SOURCES/ SPECS/ SRPMS/
[root#f004c6a0-adee-4735-792f-8e237f645751 be0f50d1]# ls -al srpm/rpmbuild/
BUILD/ BUILDROOT/ RPMS/ SOURCES/ SPECS/ SRPMS/
[root#f004c6a0-adee-4735-792f-8e237f645751 be0f50d1]# ls -al srpm/rpmbuild/SRPMS/
total 1232
drwxr-xr-x. 1 root root 58 May 31 11:43 .
drwxr-xr-x. 1 root root 70 May 31 11:43 ..
-rw-r--r--. 1 root root 1260666 May 31 11:43 oregano-0.84.3-1.fc25.src.rpm
choose a container: 2
/tmp/build/put # ls -al
total 0
drwxr-xr-x 1 root root 82 May 31 11:43 .
drwxr-xr-x 1 root root 6 May 31 11:43 ..
drwxr-xr-x 1 root root 414 May 31 11:31 git-clone-resource
drwxr-xr-x 1 root root 130 May 23 07:25 oregano-test-fedora
drwxr-xr-x 1 42949672 42949672 0 May 31 11:43 srpm
/tmp/build/put # #ls -al srpm/
/tmp/build/put # #ls -al srpm/
/tmp/build/put # #ls -al ../srpm
/tmp/build/put # ls -al ../srpm
ls: ../srpm: No such file or directory
/tmp/build/put # ls -al srpm
total 0
drwxr-xr-x 1 42949672 42949672 0 May 31 11:43 .
drwxr-xr-x 1 root root 82 May 31 11:43 ..
So why is the file structure nor oregano-*.src.rpm available in the put step?
The full concourse YAML is avail here, though not necessary as far as I can tell https://github.com/drahnr/oregano/blob/master/.concourse.yml
The issue was this:
- task: create-rpm
image: oregano-test-fedora
config:
platform: linux
inputs:
- name: git-clone-resource
outputs:
- name: srpm
path: ../srpm
path: ../srpm placed the outputs outside the volume and as such the content was lost. Note that dir does not do anything regarding the inputs and outputs but just changes the workdir for the execution of the script!
The default would have sufficed which would have equaled to path: srpm (or path: "")
This works:
- task: create-rpm
image: oregano-test-fedora
config:
platform: linux
inputs:
- name: git-clone-resource
outputs:
- name: srpm

cant run uwsgi with ini file in emperror mode - Permission denied

I cant run uwsgi in emperror mode with my ini file. I have installed uwsgi with sudo pip install uwsgi.
When I try to start uwsgi, I get error:
sudo /etc/init.d/uwsgi start
/etc/init.d/uwsgi: line 72: /usr/share/uwsgi/init/snippets: No such file or directory
/etc/init.d/uwsgi: line 73: /usr/share/uwsgi/init/do_command: No such file or directory
[....] Starting app server(s): uwsgi/etc/init.d/uwsgi: line 80: do_command: command not found
failed!
I'm using Debian. Firstly I tried to follow django and nginx docs, but when it did not work I googled a lot.
This is my ebook_uwsgi.ini file:
# ebook_uwsgi.ini file
[uwsgi]
emperor = /etc/uwsgi/vassals
#plugins = python #if uwsgi installed with pip, dont have to use this line
# Django-related settings
# the base directory (full path)
chdir = /var/www/django/ebook/ebook/wsgi/ebook/
# Django's wsgi file
module = controller.wsgi:application
# the virtualenv (full path)
home = /var/www/django/ebook
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = /var/uwsgi/ebook.sock
# ... with appropriate permissions - may be needed
chmod-socket = 664
uid = www-data
gid = www-data
# clear environment on exit
vacuum = true
no-site = True
wsgi-file = /var/www/django/ebook/ebook/wsgi/ebook/controller/wsgi.py
env = DJANGO_SETTINGS_MODULE=controller.settings # set an environment variable
And here is my ebook_nginx.conf:
# mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream django {
server unix:///var/uwsgi/ebook.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 8001;
# the domain name it will serve for
server_name IP #.bookdownloading.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /var/www/django/ebook/ebook/data; # your Django project's media files - amend as required
}
location /static {
alias /var/www/django/ebook/ebook/wsgi/static/; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
include /var/www/django/ebook/ebook/uwsgi_params; # the uwsgi_params file you installed
}
}
Where IP stands for servers real IP.
When I start uwgi with my ini file I get Permission denied:
uwsgi --ini ebook_uwsgi.ini
[uWSGI] getting INI configuration from ebook_uwsgi.ini
*** Starting uWSGI 2.0.10 (64bit) on [Tue Apr 14 17:11:32 2015] ***
compiled with version: 4.7.2 on 14 April 2015 16:47:40
os: Linux-2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015
nodename: zoltan
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /var/www/django/ebook/ebook
detected binary path: /usr/local/bin/uwsgi
chdir() to /var/www/django/ebook/ebook/wsgi/ebook/
your processes number limit is 2062113
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
*** starting uWSGI Emperor ***
bind(): Permission denied [core/socket.c line 230]
I am using socked in /var/uwsgi/ebook.sock where I have set www-data as owner of uwsgi directory:
ls -la /var
total 128
drwxr-xr-x 13 root root 15 apr 14 16:29 .
drwxr-xr-x 23 root root 23 apr 12 19:46 ..
drwxr-xr-x 2 root root 19 apr 13 06:25 backups
...
drwxr-xr-x 2 www-data www-data 2 apr 14 16:36 uwsgi
Why do I get Permission denied?
//EDIT:
I was missing some config settings. So here is my new ini file:
# ebook_uwsgi.ini file
[uwsgi]
#emperor = /etc/uwsgi/vassals
#plugins = python #if uwsgi installed with pip, dont have to use this line
# Django-related settings
# the base directory (full path)
chdir = /var/www/django/ebook/ebook/wsgi/ebook/
# Django's wsgi file
module = controller.wsgi:application
# the virtualenv (full path)
home = /var/www/django/ebook
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 1
# the socket (use the full path to be safe
socket = /var/uwsgi/ebook.sock
# ... with appropriate permissions - may be needed
chmod-socket = 664
uid = www-data
gid = www-data
# clear environment on exit
vacuum = true
no-site = True
wsgi-file = /var/www/django/ebook/ebook/wsgi/ebook/controller/wsgi.py
#env = DJANGO_SETTINGS_MODULE=controller.settings # set an environment variable
and nginx settings:
# mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream ebook {
server unix:///var/uwsgi/ebook.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 8001 default_server;
# the domain name it will serve for
server_name IP; #.bookdownloading.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /var/www/django/ebook/ebook/data; # your Django project's media files - amend as required
}
location /static {
alias /var/www/django/ebook/ebook/wsgi/static/; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass ebook;
include /var/www/django/ebook/ebook/uwsgi_params; # the uwsgi_params file you installed
}
}
No matter if I run uwsgi or not, I get 502 Bad Gateway. Error nginx log:
2015/05/12 16:22:08 [crit] 3002#0: *1 connect() to unix:///var/uwsgi/ebook.sock failed (13: Permission denied) while connecting to upstream, client: 78.45.37.119, server: IP, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///var/uwsgi/ebook.sock:", host: "IP:8001"
Hm, even though I have set owner of stocket file to www-data, it was created as my user and nginx could not read it.
I've read your post and you're getting the permission issue because maybe www-data don't have write permissions on the folder uwsgi, you have two ways of testing it:
Log in with the www-data user and try to create a file inside /var/uwsgi/
To log in with www-data user su - www-data
Change the folder permissions to 775 (chmod 775 /var/uwsgi/)
Another option could be try to change the path of the sockets to the tmp folder. I tried your configuration in a VM using tmp folder and it works perfectly
ebook_uwsgi.ini:
socket = /tmp/ebook.sock
ebook_nginx.conf:
upstream django {
server unix:///tmp/ebook.sock;
}
I too faced the same.
/usr/share/uwsgi/init/snippets and /usr/share/uwsgi/init/do_commands
Above two files are missing with pip install uwsgi
But apt-get install uwsgi adds above two files and resolves issue
Somehow, when I run uwsgi from my linux user, uwsgi ignored my ini file and created ebook.sock with owner and group of my user, not specified www-data. When I changed owner and group manually to www-data, web loaded.
Problem was with permissions for file uwsgi_params. After using nginx file it worked all right.

mercurial-server hook not working

mercurial-server runs on Ubuntu 12.04 LTS
myserver#ip:/etc$ hg --version
Mercurial Distributed SCM (version 2.0.2)
myserver#ip:/etc$ dpkg -s mercurial-server
Package: mercurial-server
Version: 1.2-1
....
myserver#ip:/etc/mercurial-server/remote-hgrc.d$ ls -ltr
total 12
-rw-r--r-- 1 root root 180 Oct 10 2011 logging.rc
-rw-r--r-- 1 root root 139 Oct 10 2011 access.rc
-rw-r--r-- 1 root root 74 Mar 13 22:14 check.rc
myserver#ip:/etc/mercurial-server/remote-hgrc.d$ cat check.rc
[hooks]
pretxncommit.author_check = /SOURCE/mercurial-server/validate.sh
#manually added here too
myserver#ip:/etc/mercurial-server/remote-hgrc.d$ cat ~hg/repos/hgadmin/.hg/hgrc
# WARNING: when these hooks run they will entirely destroy and rewrite
# ~/.ssh/authorized_keys
[extensions]
hgext.purge =
[hooks]
changegroup.aaaab_update = hg update -C default > /dev/null
changegroup.aaaac_purge = hg purge --all > /dev/null
changegroup.refreshauth = python:mercurialserver.refreshauth.hook
pretxncommit.author_check = /SOURCE/mercurial-server/validate.sh
myserver#ip:/etc/mercurial-server/remote-hgrc.d$ cat /SOURCE/mercurial-server/validate.sh
#!/bin/bash
echo "REMUSR:$REMOTE_USER"
echo "ATHR:`hg tip --template "{author}\n"`b"
exit 1
myserver#ip:~$ sudo -u hg cat ~hg/.ssh/authorized_keys
no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/usr/share/mercurial-server/hg-ssh root/user1/user1.pub" ssh-rsa AAAAB3xOMN8ZiF user1#server.com
no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/usr/share/mercurial-server/hg-ssh users/user2/user2.pub" ssh-rsa AAAAB3N..0HchQQw== user2#server.com
After this from a local machine(Windows) I cloned a testproject ,changed,commited,push and it was successfull without any error or message.I tried this with both the initial user/key and a user/key added via hgadmin push
D:\hg\testproj>hg push
pushing to ssh://hg#myserver.com/testproj
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
Works with
$ cat check.rc
[hooks]
pretxnchangegroup.author_check = /SOURCE/mercurial-server/validate.sh
Not working with pretxncommit