Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aMD4S-0008Ax-9X for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Jan 2016 11:06:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aMD4R-0003fo-Ju for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Jan 2016 11:06:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aMD3o-0002yz-8Z for pgsql-bugs@postgresql.org; Thu, 21 Jan 2016 11:05:52 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aMD3g-0005tq-Ip for pgsql-bugs@postgresql.org; Thu, 21 Jan 2016 11:05:51 +0000 Received: by mail-pf0-x234.google.com with SMTP id q63so22607331pfb.1 for ; Thu, 21 Jan 2016 03:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=33ceFhCEGombISySvg6cfjy9HwwDbQe5oo1ocmS1eZQ=; b=JT61ijLIYtmfEa2Qb5wYQK09/bRjjidJzbD5tiBhELgwzJIjwgG6pznybc6mF5zKdz 6m9WdKzXVWF6ItDbI5KnIPiZwsyGqChO5KIH5KwlzAKgiyJGA9EtV22WNx3ySwQLTuPF Y9qqYwureS4gS5+FMC1AYE7M1pxtd3mOWU2M8TtafnKJK4Z9YZk2uDsVjYI71laPjnjj fJKugFYHkmrj3WZcUMk3KoY1e6PmyUYx8NGspnAuWuCWKiOSY9xTjhAwt9BFH1WYABSK 5URRW/OdeMwAHynWZw36v1QGfUo2zqTCJDh5cnjAYaE0WFiY0kpwmTRhSPHaUD94DnjU i81A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=33ceFhCEGombISySvg6cfjy9HwwDbQe5oo1ocmS1eZQ=; b=k4gE9Me9XgeCePmOE8B8DaHvBAvkGO0jExnQZFMKYHUHdFgbl3upDHLe2TxCQW259b hrGmH6IKZ1xjbQVrXFkRzAYO2xXCKQ+46WI/Cih6h5R/OzizgplSr9SVeIdQdSMBzJon 2Yvo19OuADhQx7GYy/fenCcAahUDd0oKcOMUynuc19I5FSVRsvjJtnKmlVNbzmyY6LJC 7fF6dx+/+vMJ+cU7MP7SUlR0NJ4GulMa54RwRsM79NzYnETYDCKOEAMlL6hhRas9UsTq Gu/F5I+PRnqd78i7jJxdfL0CTiriAnIK3HtA7KBU4va8QDTeMDGnjqEe3acBlaYI6WgV 7jdg== X-Gm-Message-State: ALoCoQkRjXTDv0SVLe2YMgY67csOPUwil99z66s2fGUVJvQ43H/DwGBREzfe8+VTCI+yD+shXrpiD7+t1fWKjelkLibM+wioEA== X-Received: by 10.98.10.198 with SMTP id 67mr59983722pfk.75.1453374342296; Thu, 21 Jan 2016 03:05:42 -0800 (PST) Received: from [10.194.233.225] (s675219.xgsspn.imtp.tachikawa.spmode.ne.jp. [49.98.175.219]) by smtp.gmail.com with ESMTPSA id 69sm1834668pfn.43.2016.01.21.03.05.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 03:05:40 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-1834014F-DF68-4E7D-BF4C-11AC8EC6D72E Mime-Version: 1.0 (1.0) Subject: Re: Window2012R2: initdb error: "The current directory is invalid." From: Dang Minh Huong X-Mailer: iPhone Mail (13C75) In-Reply-To: <20160119222848.GB18963@vinny.peecee3.com> Date: Thu, 21 Jan 2016 20:05:37 +0900 Cc: Thomas Kellerer , pgsql-bugs@postgresql.org Content-Transfer-Encoding: 7bit Message-Id: References: <75DB81BEEA95B445AE6D576A0A5C9E9364CAD50F@BPXM05GP.gisp.nec.co.jp> <041201d152bf$a508bee0$ef1a3ca0$@gmail.com> <20160119222848.GB18963@vinny.peecee3.com> To: cpolish@surewest.net X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --Apple-Mail-1834014F-DF68-4E7D-BF4C-11AC8EC6D72E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Thank you all for your advices. We have simply solved this problem with change the running initdb's folder t= o not to "c:\windows\temp\something". Best regards, bocap. Ng=C3=A0y 20-01-2016, v=C3=A0o l=C3=BAc 07:28, cpolish@surewest.net vi=E1=BA= =BFt: > On 2016-01-19 22:45, Dang Minh Huong wrote: >>> owner@postgresql.org] On Behalf Of Thomas Kellerer >>> Huong Dangminh schrieb am 19.01.2016 um 11:49: >>>> I have failed in execute initdb in "c:\Windows\Temp\dir" folder as >>>> reproduce logs below. The OS's messages "The current directory is inval= id." >>>> was returned. >>>=20 >>> c:\Windows has special protection and it is not really surprising that a= regular >>> user isn't allowed to write into that directory. >>>=20 >>> When Postgres is started it drops all "Administrator" privileges for sec= urity >>> reasons (older versions would refuse to start as >>> Administrator) - and I think initdb is doing the same thing. >>> So it's understandable that it can't write to c:\Windows >>=20 >> I did not mean, create data cluster in C drive made that error sir. >> This issue reproduce in all drive specified in -D option. >> # My reproduce environment is only one (C) drive. So, sorry for the log. >>=20 >> I mean, it happen when current directory of command line is "c:\Windows\T= emp\something". >> It is rare case, and may be a Windows2012's specification, but i don't kn= ow >> why only "c:\Windows\Temp\something" and are there another case like that= ? >>=20 >>> Putting application data into c:\Windows (or "c:\Program Files" for that= >>> matter) is an extremely bad idea to begin with (c:\Windows being even >>> worse than "c:\Program Files") >>>=20 >>> You shouldn't be doing that anyway. >=20 > As Thomas said, it is undesireable to log into a server as > administrator. You should create and use a privileged user, for > example dmhadmin, insert that user into the administrators > group. Also create an ordinary user, perhaps dmh, and log in > with that account. Download the postgres installer, run it as > the ordinary user. You will be prompted for a privileged user > account, enter the priviledged account (for example, dmhadmin). > When asked for the location to install the database, create a > new folder named postgres on a non-system (not C:) disk. If your > server can only have one disk you might install the database in > C:\postgres, which you'll have the opportunity to create from > inside the installer's "browse..." dialog. This folder will be > owned by the local server's "administrators" group with > appropriate privileges.=20 >=20 > C:\Windows\Temp is not an appropriate choice for storing > persistent program data. If you ignore this by manipulating the > permissions you will eventually be harmed when a privileged > program clears the entire contents. >=20 > Hope that helps, > --=20 > Charles >=20 --Apple-Mail-1834014F-DF68-4E7D-BF4C-11AC8EC6D72E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,

Thank you all for your advices.

We have simply s= olved this problem with change the running initdb's folder to not to "c:\win= dows\temp\something".

Best regards,
bocap.
=

Ng=C3=A0y 20-01-2016, v=C3=A0o l=C3=BAc 07:28, cpolish@surewest.net vi=E1=BA=BFt:

On 2016-01-19 22:45, Dang Minh Huong wrote:=
owner@postgresql.org] On Behalf Of Thom= as Kellerer
Huong Dangminh schrieb am 19.01.2016 um 11:49:=
I have failed in execute initdb= in "c:\Windows\Temp\dir" folder as
reproduce logs below. The OS's messages "The current direct= ory is invalid."
wa= s returned.

c:\Windows has= special protection and it is not really surprising that a regular
user isn't allowed to write into that directory.
=
When Postgres is started it drops all "Administrator" pri= vileges for security
reasons (older versions would refuse t= o start as
Administrator) - and I think initdb is doing th= e same thing.
=
So it's understandable that it can't write t= o c:\Windows
<= blockquote type=3D"cite">

I did not mean, create data cluster in C drive made that error sir.
This issue reproduce in a= ll drive specified in -D option.
# My reproduce environment is only one (C) drive. So, sorry for t= he log.

I mean, it happen when current di= rectory of command line is "c:\Windows\Temp\something".
It is rare case, and may be a Windows2012= 's specification, but i don't know
why only "c:\Windows\Temp\something" and are there another case= like that?
Put= ting application data into c:\Windows (or "c:\Program Files" for that=
matter) is an extremely bad idea to begin with (c:\Windows being= even
worse than "c:\Program Files")

You shouldn't be doing that anyway.
<= /blockquote>
As Thomas said, it is undesireable to log= into a server as
administrator. You should create and use a= privileged user, for
example dmhadmin, insert that user int= o the administrators
group. Also create an ordinary user, pe= rhaps dmh, and log in
with that account. Download the postgr= es installer, run it as
the ordinary user. You will be promp= ted for a privileged user
account, enter the priviledged acc= ount (for example, dmhadmin).
When asked for the location to= install the database, create a
new folder named postgres on= a non-system (not C:) disk. If your
server can only have on= e disk you might install the database in
C:\postgres, which y= ou'll have the opportunity to create from
inside the install= er's "browse..." dialog. This folder will be
owned by the lo= cal server's "administrators" group with
appropriate privile= ges.

C:\Windows\Temp is not an appropriate= choice for storing
persistent program data. If you ignore t= his by manipulating the
permissions you will eventually be h= armed when a privileged
program clears the entire contents.<= /span>

Hope that helps,
-- =
Charles

= --Apple-Mail-1834014F-DF68-4E7D-BF4C-11AC8EC6D72E--