Re: Screwed-up postgresql13 install

2021-02-03 Thread Peter West
Firstly, the su problem was because I was still in my home directory. When I 
sudo su - Postgres (note the minus) all is OK.

In my travels I discovered dscl, which I had managed not to encounter over many 
long year. How very handy it is. I deleted the postgres user with ddcl, and 
then re-installed postgresql13 and server.

One thing that causes confusion is that the _postgres user in /etc/passwd has a 
different UID and GID from the dscl user and group. It’s the same on Mojave. I 
have no idea what these /etc/passwd entries are about, given the underlying 
differences.

Peter

—
Peter West
peter.b.w...@ehealth.id.au
“A prophet is not without honor, except in his hometown and among his relatives 
and in his own household.”


> On 4 Feb 2021, at 11:45 am, Ryan Schmidt  wrote:
> 
> 
> 
> On Feb 3, 2021, at 09:04, Peter West wrote:
> 
>> MacOS Big Sur 11.2 MacBook Air M1
>> 
>> I’m migrating to the M1 from an Intel MacBook Pro running Mojave.
>> 
>> I installed postgresql13 and -server, and copied my defaultdb across from 
>> the Pro.
>> 
>> I can’t vouch for the order of these things, because I wasn’t expecting to 
>> get into a quagmire.
>> 
>> I tried to give the postgres user a password using passwd as root. That’s 
>> not enough. I have to use a command ’security’ with a reference to a 
>> Keychain to complete the process. In the wake of all this, I assume that the 
>> user postgres is created without a password, and that’s Ok with the default 
>> pg_hba.conf.
> 
> As far as I know, anytime MacPorts creates a macOS user account on behalf of 
> a portfile that requests it, it does so without a password, and this is not 
> thought to be a problem. The user accounts do not have a shell set so nobody 
> could log into them.
> 
> 
>> Then I thought that maybe I should build up the databases by dumping 
>> databases from the Pro and restoring to the M1. So I uninstalled the 
>> postgresql ports and tried to delete /opt/local/var/db/postgresql13. The 
>> defaultdb disappeared but root was not allowed to remove a directory Library 
>> sitting beside the defaultdb. It had Preferences and Keychains subdirs, and 
>> they wouldn’t go.
> 
> I am not certain why. I do not have much experience with macOS 11 yet.
> 
> 
>> I deleted the postgres user through the System Preferences, but that left 
>> the entry for _postgres in /etc/passwd.
> 
> The fact that the postgres user was visible in System Preferences indicates a 
> problem. macOS user accounts that MacPorts creates for you are not visible in 
> System Preferences.
> 
> You said you migrated from another Mac. In my experience, the migration 
> assistant will migrate any MacPorts-created user accounts improperly. After 
> migration, the accounts will appear in System Preferences, and their home 
> directories will have been moved into /Users, which may make the ports that 
> use those user accounts not work correctly. Cleaning up the user migration 
> mess that the migration assistant leaves behind is not easy. Whenever I 
> migrate, I choose not to migrate MacPorts-created user accounts and instead 
> have MacPorts recreate them properly.
> 
> I believe the entry for _postgres in /etc/passwd is fine and normal on any 
> macOS system. Apple puts it there, along with creating the _postgres macOS 
> user account. This is unrelated to the postgres macOS user account the 
> MacPorts postgresql-server ports create.
> 
> 
>> Ok, install postgresql13 again. Installation proceeded, but this time did 
>> not create the postgres user visible through System Preferences, which I 
>> assume was created when I first installed.
> 
> You can check on the command line whether the postgres user created by 
> MacPorts exists:
> 
> id postgres
> 
> If that doesn't show "no such user", you're fine.
> 
> 
>> When I try to access the macports wrapper (via su) to start the database, I 
>> get the complaint
>> shell-init: error retrieving current directory: getcwd: cannot access parent 
>> directories: Permission denied
>> could not identify current directory: Permission denied (3times)
>> The program “postgres” is needed by pg_ctl but was not found in the same 
>> directory as pg_ctl
>> (for obvious reasons, me)
>> Check your installation.
>> (you don’t say)
> 
> Not sure, but try cd'ing to a different directory before doing what you did. 
> Maybe you were in a directory that no longer existed. MacPorts has a similar 
> error message that can appear if you are in a port's directory when you run 
> `sudo port sync` because (if you sync with rsync) that deletes all port 
> directories and recreates them.
> 








Re: Screwed-up postgresql13 install

2021-02-03 Thread Ryan Schmidt



On Feb 3, 2021, at 09:04, Peter West wrote:

> MacOS Big Sur 11.2 MacBook Air M1
> 
> I’m migrating to the M1 from an Intel MacBook Pro running Mojave.
> 
> I installed postgresql13 and -server, and copied my defaultdb across from the 
> Pro.
> 
> I can’t vouch for the order of these things, because I wasn’t expecting to 
> get into a quagmire.
> 
> I tried to give the postgres user a password using passwd as root. That’s not 
> enough. I have to use a command ’security’ with a reference to a Keychain to 
> complete the process. In the wake of all this, I assume that the user 
> postgres is created without a password, and that’s Ok with the default 
> pg_hba.conf.

As far as I know, anytime MacPorts creates a macOS user account on behalf of a 
portfile that requests it, it does so without a password, and this is not 
thought to be a problem. The user accounts do not have a shell set so nobody 
could log into them.


> Then I thought that maybe I should build up the databases by dumping 
> databases from the Pro and restoring to the M1. So I uninstalled the 
> postgresql ports and tried to delete /opt/local/var/db/postgresql13. The 
> defaultdb disappeared but root was not allowed to remove a directory Library 
> sitting beside the defaultdb. It had Preferences and Keychains subdirs, and 
> they wouldn’t go.

I am not certain why. I do not have much experience with macOS 11 yet.


> I deleted the postgres user through the System Preferences, but that left the 
> entry for _postgres in /etc/passwd.

The fact that the postgres user was visible in System Preferences indicates a 
problem. macOS user accounts that MacPorts creates for you are not visible in 
System Preferences.

You said you migrated from another Mac. In my experience, the migration 
assistant will migrate any MacPorts-created user accounts improperly. After 
migration, the accounts will appear in System Preferences, and their home 
directories will have been moved into /Users, which may make the ports that use 
those user accounts not work correctly. Cleaning up the user migration mess 
that the migration assistant leaves behind is not easy. Whenever I migrate, I 
choose not to migrate MacPorts-created user accounts and instead have MacPorts 
recreate them properly.

I believe the entry for _postgres in /etc/passwd is fine and normal on any 
macOS system. Apple puts it there, along with creating the _postgres macOS user 
account. This is unrelated to the postgres macOS user account the MacPorts 
postgresql-server ports create.


> Ok, install postgresql13 again. Installation proceeded, but this time did not 
> create the postgres user visible through System Preferences, which I assume 
> was created when I first installed.

You can check on the command line whether the postgres user created by MacPorts 
exists:

id postgres

If that doesn't show "no such user", you're fine.


> When I try to access the macports wrapper (via su) to start the database, I 
> get the complaint
> shell-init: error retrieving current directory: getcwd: cannot access parent 
> directories: Permission denied
> could not identify current directory: Permission denied (3times)
> The program “postgres” is needed by pg_ctl but was not found in the same 
> directory as pg_ctl
> (for obvious reasons, me)
> Check your installation.
> (you don’t say)

Not sure, but try cd'ing to a different directory before doing what you did. 
Maybe you were in a directory that no longer existed. MacPorts has a similar 
error message that can appear if you are in a port's directory when you run 
`sudo port sync` because (if you sync with rsync) that deletes all port 
directories and recreates them.



Re: Screwed-up postgresql13 install

2021-02-03 Thread Ryan Schmidt



On Feb 3, 2021, at 18:25, Peter West wrote:

> Where is the function add_users defined? I see it in the Portfile for 
> postgresql13-server.

It is documented in "man portfile"

The option is created here:

https://github.com/macports/macports-base/blob/master/src/port1.0/portmain.tcl#L63

Its default value (empty) is set here:

https://github.com/macports/macports-base/blob/master/src/port1.0/portmain.tcl#L124

The code that creates the macOS users and groups based on the value the 
portfile sets this option to is here:

https://github.com/macports/macports-base/blob/master/src/port1.0/portutil.tcl#L2318-L2339

The adduser and addgroup procedures that add_users calls are below that.



Re: SDK does not appear to be installed

2021-02-03 Thread Joshua Root

Gary Palter wrote:

The release notes for Xcode 12.4 state that it includes the 11.1 SDK. 
Apparently, there’s no version of Xcode with an 11.2 SDK. (Xcode 12.5 has the 
11.3 SDK.)


Right. At the time MacPorts 2.6.4 was released, it wasn't entirely clear 
how the SDK versions (and OS versions) were going to progress now. So it 
incorrectly assumes that the version in the SDK name that should be used 
will match the first two segments of the OS version, which is how it 
worked on previous macOS releases.


This will be fixed in an upcoming release. In the meantime, it's safe to 
ignore the warning as long as you have the latest Xcode and Command Line 
Tools, since MacPorts will fall back to using MacOSX.sdk.


Ensuring you have the latest Command Line Tools can actually be 
challenging due to the Apple bug documented here: 



I don't know if it's fixed on Bug Sur, but the CLT receipt disappeared 
again with the latest Catalina security update.


- Josh


Re: Screwed-up postgresql13 install

2021-02-03 Thread Peter West
Where is the function add_users defined? I see it in the Portfile for 
postgresql13-server.

Peter

--
Peter West
p...@pbw.id.au
“…a light for revelation to the Gentiles, and for glory to your people Israel.”

> On 4 Feb 2021, at 1:04 am, Peter West  wrote:
> 
> MacOS Big Sur 11.2 MacBook Air M1
> 
> I’m migrating to the M1 from an Intel MacBook Pro running Mojave.
> 
> I installed postgresql13 and -server, and copied my defaultdb across from the 
> Pro.
> 
> I can’t vouch for the order of these things, because I wasn’t expecting to 
> get into a quagmire.
> 
> I tried to give the postgres user a password using passwd as root. That’s not 
> enough. I have to use a command ’security’ with a reference to a Keychain to 
> complete the process. In the wake of all this, I assume that the user 
> postgres is created without a password, and that’s Ok with the default 
> pg_hba.conf.
> 
> Then I thought that maybe I should build up the databases by dumping 
> databases from the Pro and restoring to the M1. So I uninstalled the 
> postgresql ports and tried to delete /opt/local/var/db/postgresql13. The 
> defaultdb disappeared but root was not allowed to remove a directory Library 
> sitting beside the defaultdb. It had Preferences and Keychains subdirs, and 
> they wouldn’t go.
> 
> I deleted the postgres user through the System Preferences, but that left the 
> entry for _postgres in /etc/passwd.
> 
> Ok, install postgresql13 again. Installation proceeded, but this time did not 
> create the postgres user visible through System Preferences, which I assume 
> was created when I first installed.
> 
> When I try to access the macports wrapper (via su) to start the database, I 
> get the complaint
> shell-init: error retrieving current directory: getcwd: cannot access parent 
> directories: Permission denied
> could not identify current directory: Permission denied (3times)
> The program “postgres” is needed by pg_ctl but was not found in the same 
> directory as pg_ctl
> (for obvious reasons, me)
> Check your installation.
> (you don’t say)
> 
> Any advice on how I can clean this up and start again.
> 
> Peter
> 
> --
> Peter West
> p...@pbw.id.au
> “…a light for revelation to the Gentiles, and for glory to your people 
> Israel.”
> 





Re: SDK does not appear to be installed

2021-02-03 Thread Gary Palter
The release notes for Xcode 12.4 state that it includes the 11.1 SDK. 
Apparently, there’s no version of Xcode with an 11.2 SDK. (Xcode 12.5 has the 
11.3 SDK.)

  - Gary

> On Feb 3, 2021, at 4:35 PM, Tom  wrote:
> 
> That does not seem to work for Big Sur 11.2 and Xcode 12.4 this time.
> 
>> On 3. Feb 2021, at 22:33, Henning Hraban Ramm  wrote:
>> 
>> For MacOS 10.14 (XCode 11.3) I solved the same problem by downloading the 
>> CLI tools from developer.apple.com and installing them.
>> 
>> Hraban
>> 
 Am 03.02.2021 um 21:12 schrieb Marius Schamschula :
>>> 
>>> Indeed!
>>> 
>>> I just upgraded a machine to Big Sur, installed Xcode and the CLI tools. I 
>>> got the same message. I used the reinstall procedure - no change.
>>> 
>>> My guess is that the CLI tools for 11.2 are not out yet.
>>> 
 On Feb 3, 2021, at 2:08 PM, Tom  wrote:
 
 Hello people,
 
 what was the solution to this problem?
 I cannot find the e-mail anymore.
 
> Warning: The macOS 11.2 SDK does not appear to be installed. Ports may 
> not build correctly.
> Warning: You can install it as part of the Xcode Command Line Tools 
> package by running `xcode-select --install'.
>> 
> 



Re: SDK does not appear to be installed

2021-02-03 Thread Tom
That does not seem to work for Big Sur 11.2 and Xcode 12.4 this time.

> On 3. Feb 2021, at 22:33, Henning Hraban Ramm  wrote:
> 
> For MacOS 10.14 (XCode 11.3) I solved the same problem by downloading the CLI 
> tools from developer.apple.com and installing them.
> 
> Hraban
> 
>> Am 03.02.2021 um 21:12 schrieb Marius Schamschula :
>> 
>> Indeed!
>> 
>> I just upgraded a machine to Big Sur, installed Xcode and the CLI tools. I 
>> got the same message. I used the reinstall procedure - no change.
>> 
>> My guess is that the CLI tools for 11.2 are not out yet.
>> 
>>> On Feb 3, 2021, at 2:08 PM, Tom  wrote:
>>> 
>>> Hello people,
>>> 
>>> what was the solution to this problem?
>>> I cannot find the e-mail anymore.
>>> 
 Warning: The macOS 11.2 SDK does not appear to be installed. Ports may not 
 build correctly.
 Warning: You can install it as part of the Xcode Command Line Tools 
 package by running `xcode-select --install'.
> 



Re: SDK does not appear to be installed

2021-02-03 Thread Henning Hraban Ramm
For MacOS 10.14 (XCode 11.3) I solved the same problem by downloading the CLI 
tools from developer.apple.com and installing them.

Hraban

> Am 03.02.2021 um 21:12 schrieb Marius Schamschula :
> 
> Indeed!
> 
> I just upgraded a machine to Big Sur, installed Xcode and the CLI tools. I 
> got the same message. I used the reinstall procedure - no change.
> 
> My guess is that the CLI tools for 11.2 are not out yet.
> 
>> On Feb 3, 2021, at 2:08 PM, Tom  wrote:
>> 
>> Hello people,
>> 
>> what was the solution to this problem?
>> I cannot find the e-mail anymore.
>> 
>>> Warning: The macOS 11.2 SDK does not appear to be installed. Ports may not 
>>> build correctly.
>>> Warning: You can install it as part of the Xcode Command Line Tools package 
>>> by running `xcode-select --install'.



signature.asc
Description: Message signed with OpenPGP


Re: SDK does not appear to be installed

2021-02-03 Thread Marius Schamschula
Indeed!

I just upgraded a machine to Big Sur, installed Xcode and the CLI tools. I got 
the same message. I used the reinstall procedure - no change.

My guess is that the CLI tools for 11.2 are not out yet.

> On Feb 3, 2021, at 2:08 PM, Tom  wrote:
> 
> Hello people,
> 
> what was the solution to this problem?
> I cannot find the e-mail anymore.
> 
>> Warning: The macOS 11.2 SDK does not appear to be installed. Ports may not 
>> build correctly.
>> Warning: You can install it as part of the Xcode Command Line Tools package 
>> by running `xcode-select --install'.
> 
> 



Marius
--
Marius Schamschula





SDK does not appear to be installed

2021-02-03 Thread Tom
Hello people,

what was the solution to this problem?
I cannot find the e-mail anymore.

> Warning: The macOS 11.2 SDK does not appear to be installed. Ports may not 
> build correctly.
> Warning: You can install it as part of the Xcode Command Line Tools package 
> by running `xcode-select --install'.




Screwed-up postgresql13 install

2021-02-03 Thread Peter West
MacOS Big Sur 11.2 MacBook Air M1

I’m migrating to the M1 from an Intel MacBook Pro running Mojave.

I installed postgresql13 and -server, and copied my defaultdb across from the 
Pro.

I can’t vouch for the order of these things, because I wasn’t expecting to get 
into a quagmire.

I tried to give the postgres user a password using passwd as root. That’s not 
enough. I have to use a command ’security’ with a reference to a Keychain to 
complete the process. In the wake of all this, I assume that the user postgres 
is created without a password, and that’s Ok with the default pg_hba.conf.

Then I thought that maybe I should build up the databases by dumping databases 
from the Pro and restoring to the M1. So I uninstalled the postgresql ports and 
tried to delete /opt/local/var/db/postgresql13. The defaultdb disappeared but 
root was not allowed to remove a directory Library sitting beside the 
defaultdb. It had Preferences and Keychains subdirs, and they wouldn’t go.

I deleted the postgres user through the System Preferences, but that left the 
entry for _postgres in /etc/passwd.

Ok, install postgresql13 again. Installation proceeded, but this time did not 
create the postgres user visible through System Preferences, which I assume was 
created when I first installed.

When I try to access the macports wrapper (via su) to start the database, I get 
the complaint
shell-init: error retrieving current directory: getcwd: cannot access parent 
directories: Permission denied
could not identify current directory: Permission denied (3times)
The program “postgres” is needed by pg_ctl but was not found in the same 
directory as pg_ctl
(for obvious reasons, me)
Check your installation.
(you don’t say)

Any advice on how I can clean this up and start again.

Peter

--
Peter West
p...@pbw.id.au
“…a light for revelation to the Gentiles, and for glory to your people Israel.”