Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer assumes postgresql admin user name is 'postgres' #3905

Closed
pameyer opened this issue Jun 14, 2017 · 14 comments
Closed

installer assumes postgresql admin user name is 'postgres' #3905

pameyer opened this issue Jun 14, 2017 · 14 comments
Labels
Feature: Installer Type: Bug a defect User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh

Comments

@pameyer
Copy link
Contributor

pameyer commented Jun 14, 2017

Installer fails when the administrative user is not 'postgres' (as is the case for home-brew installation on OS X). Can be worked-around by creating appropriate user manually; may be worth fixing in installation script.

@pdurbin
Copy link
Member

pdurbin commented Jun 15, 2017

@pameyer as part of this, should what's currently at http://guides.dataverse.org/en/4.6.2/_downloads/default.config be updated to include a new configuration option for the administrative user for postgres? Thanks again for adding the non-interactive installation method in #3799.

@pameyer
Copy link
Contributor Author

pameyer commented Jun 19, 2017

@pdurbin It would make sense to me to put it there, but the installer will need to be modified to do anything with it. Lower-hanging fruit might be to mention in the installation guide that the admin user is assumed to be named postgres.

@pdurbin
Copy link
Member

pdurbin commented Jun 19, 2017

@pameyer yeah, agreed. Let's figure out the scope of this issue before we estimate it.

@pdurbin pdurbin added the User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. label Jul 4, 2017
pdurbin added a commit to pdurbin/dataverse that referenced this issue Oct 26, 2017
@pdurbin
Copy link
Member

pdurbin commented Oct 26, 2017

While I was dinking around with upgrading to Glassfish 5 for #4217 I thought "Now that our official installer no longer requires root to run, maybe I'll try setting up Glassfish with the official installer rather than using my own script." Unfortunately, I ran into this issue since I don't have a "postgres" user on my Mac. I started hacking on a solution which is mixed in with Glassfish upgrades at pdurbin@d757099 but hopefully it will be helpful to someone in the future.

@pdurbin
Copy link
Member

pdurbin commented Oct 27, 2017

Fixed in pull request #4244. Moved to Code Review at https://waffle.io/IQSS/dataverse

@pdurbin pdurbin removed Help Wanted: Code Mentor: pdurbin Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. labels Oct 27, 2017
@djbrooke
Copy link
Contributor

@pameyer - is this something that you have interest in code reviewing?

@pameyer
Copy link
Contributor Author

pameyer commented Oct 31, 2017

@pdurbin the installer in #4244 is still using psql -U postgres in a few places.

@pameyer pameyer removed their assignment Oct 31, 2017
@pdurbin
Copy link
Member

pdurbin commented Nov 1, 2017

@pameyer and I talked this out after standup (thanks!) and sure enough, there are still some cases of -U postgres in https://github.com/IQSS/dataverse/blob/153027390a701e0a54ce71f3249173de2a5993a5/scripts/installer/install

Now I need to decide what I want to do with this issue. It turns out @pameyer opened this issue for someone else during the hackathon and isn't personally invested in it. As far as I know, I may be the only person at IQSS installing postgres with homebrew so I may be the only one affected. http://guides.dataverse.org/en/4.8/developers/dev-environment.html#postgresql continues to be quite light on how developers should install postgres.

I still think back to the "pick your poison" slide I made for http://bl.ocks.org/pdurbin/raw/7847a0642f8bd6601a07c3619b4a35f6/#2

screen shot 2017-11-01 at 12 19 34 pm

This was my first attempt to use the official installer now that it has two critical features:

  • doesn't require root
  • works non-interactively (mostly)

For now I'm going to pull this issue and #2443 out of code review. We should probably decouple any effort to improve the installer for developers from Glassfish 5 upgrades. Here are the main things I fixed:

  • postgres admin user can be anything (partial fix, per above)
  • insecure mode so REST Assured tests will run.
  • better at being non-interactive

I think about it some more.

@pdurbin
Copy link
Member

pdurbin commented Nov 2, 2017

See #2443 (comment) for an update about some code I pushed that I hope we can return to some day.

@pdurbin pdurbin added Help Wanted: Code Mentor: pdurbin User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. and removed Help Wanted: Code Mentor: pdurbin Status: Development User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. labels Nov 2, 2017
@pdurbin
Copy link
Member

pdurbin commented Dec 7, 2017

On a related note, there's a new bug report that a custom postgres port doesn't work either:

@pdurbin
Copy link
Member

pdurbin commented Jun 8, 2018

As far as I know, I may be the only person at IQSS installing postgres with homebrew so I may be the only one affected.

For what it's worth, while working on pull request #4721 I switched away from postgres installed by homebrew in favor of the enterprisedb version we recommend in the dev guide.

@donsizemore
Copy link
Contributor

This isn't just a homebrew problem; a lady just hit this installing against RDS. Her work-around was to make the RDS admin user postgres but as more installations will move to some cloud or another, we might want to allow a configurable Postgres admin user, or at least document the RDS case in prerequisites.rst.

@pdurbin pdurbin added Type: Bug a defect User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh labels Nov 12, 2023
@pdurbin
Copy link
Member

pdurbin commented Nov 29, 2023

"Hello everyone,

I installed Dataverse 6 using "installer.py" and encountered some issues that I'd like to share with you.

  1. The PostgreSQL administrator's name is hard-coded in the script but may vary. It should default to "pgadmin" but should be overrideable with a variable.

  2. In the case of a username with special characters, such as "my-dvuser," the query:

conn_cmd = "CREATE ROLE "+pgUser+" PASSWORD '"+pgPassword+"' NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"

failed, even putting single quotes around pgUser.

Even though the script continues because the user already exists, then, for the same reason, this other query fails:

conn_cmd = "CREATE DATABASE "+pgDb+" OWNER "+pgUser+";"

To quickly resolve this, i didn't find a real solution, I just removed special characters from the username and the database name.

  1. At this point in the installation, my database admin user still doesn't have the GRANT privileges to assign the database to the user. Therefore, I had to append to the query:

conn_cmd = "CREATE ROLE "+pgUser+" PASSWORD '"+pgPassword+"' NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; GRANT "+pgUser+" TO mypgAdmin;"

Thanks,
Alfredo"

-- @orazionelson at https://groups.google.com/g/dataverse-community/c/koHCFkUw2kw/m/e15be2hgAgAJ

@cmbz
Copy link

cmbz commented Aug 20, 2024

To focus on the most important features and bugs, we are closing issues created before 2020 (version 5.0) that are not new feature requests with the label 'Type: Feature'.

If you created this issue and you feel the team should revisit this decision, please reopen the issue and leave a comment.

@cmbz cmbz closed this as completed Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Installer Type: Bug a defect User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh
Projects
None yet
Development

No branches or pull requests

5 participants