Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1d9186

Browse files
committed
Add material about postmaster startup failure messages;
update material about client connection failure messages.
1 parentb3ad498 commita1d9186

File tree

1 file changed

+123
-15
lines changed

1 file changed

+123
-15
lines changed

‎doc/src/sgml/trouble.sgml

Lines changed: 123 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,137 @@
22
<Title>Troubleshooting</Title>
33

44
<sect1>
5-
<title>Client Connections</title>
6-
<Para>
7-
If you get the following error message from a
8-
<ProductName>Postgres</ProductName>
9-
command (such as <Application>psql</Application> or
10-
<Application>createdb</Application>):
5+
<title>Postmaster Startup Failures</title>
6+
7+
<para>
8+
There are several common reasons for the postmaster to fail to start up.
9+
Check the postmaster's log file, or start it by hand (without redirecting
10+
standard output or standard error) to see what complaint messages appear.
11+
Some of the possible error messages are reasonably self-explanatory,
12+
but here are some that are not:
13+
</para>
1114

15+
<para>
16+
<ProgramListing>
17+
FATAL: StreamServerPort: bind() failed: Address already in use
18+
Is another postmaster already running on that port?
19+
</ProgramListing>
20+
This usually means just what it suggests: you accidentally started a
21+
second postmaster on the same port where one is already running.
22+
However, if the kernel error
23+
message is not "Address already in use" or some variant of that wording,
24+
there may be a different problem. For example, trying to start a
25+
postmaster on a reserved port number may draw something like
1226
<ProgramListing>
13-
connectDB() failed: Is the postmaster running at 'localhost' on port '5432'?
27+
$ postmaster -i -p 666
28+
FATAL: StreamServerPort: bind() failed: Permission denied
29+
Is another postmaster already running on that port?
1430
</ProgramListing>
31+
</para>
1532

16-
it is usually because either the <Application>postmaster</Application> is not running,
17-
or you are attempting to connect to the wrong server host.
18-
If you get the following error message:
33+
<para>
34+
<ProgramListing>
35+
IpcMemoryCreate: shmget failed (Invalid argument) key=5440001, size=83918612, permission=600
36+
FATAL 1: ShmemCreate: cannot create region
37+
</ProgramListing>
38+
A message like this probably means that your kernel's limit on the size
39+
of shared memory areas is smaller than the buffer area that Postgres
40+
is trying to create. (Or it could mean that you don't have SysV-style
41+
shared memory support configured into your kernel at all.) As a temporary
42+
workaround, you can try starting the postmaster with a smaller-than-normal
43+
number of buffers (-B switch). You will eventually want to reconfigure
44+
your kernel to increase the allowed shared memory size, however.
45+
You may see this message when trying to start multiple postmasters on
46+
the same machine, if their total space requests exceed the kernel limit.
47+
</para>
1948

49+
<para>
2050
<ProgramListing>
21-
FATAL 1:Feb 17 23:19:55:process userid (2360) != database owner (268)
51+
IpcSemaphoreCreate: semget failed (No space left on device) key=5440026, num=16, permission=600
2252
</ProgramListing>
53+
A message like this does <emphasis>not</emphasis> mean that you've run out
54+
of disk space; it means that your kernel's limit on the number of SysV
55+
semaphores is smaller than the number Postgres wants to create. As above,
56+
you may be able to work around the problem by starting the postmaster with
57+
a reduced number of backend processes (-N switch), but you'll eventually
58+
want to increase the kernel limit.
59+
</para>
60+
61+
</sect1>
62+
63+
<sect1>
64+
<title>Client Connection Problems</title>
65+
66+
<para>
67+
Once you have a running postmaster, trying to connect to it with
68+
client applications can fail for a variety of reasons. The sample
69+
error messages shown here are for clients based on recent versions
70+
of libpq --- clients based on other interface libraries may produce
71+
other messages with more or less information.
72+
</para>
73+
74+
<para>
75+
<ProgramListing>
76+
connectDB() -- connect() failed: Connection refused
77+
Is the postmaster running (with -i) at 'server.joe.com' and accepting connections on TCP/IP port '5432'?
78+
</ProgramListing>
79+
This is the generic "I couldn't find a postmaster to talk to" failure.
80+
It looks like the above when TCP/IP communication is attempted, or like
81+
this when attempting Unix-socket communication to a local postmaster:
82+
<ProgramListing>
83+
connectDB() -- connect() failed: No such file or directory
84+
Is the postmaster running at 'localhost' and accepting connections on Unix socket '5432'?
85+
</ProgramListing>
86+
The last line is useful in verifying that the client is trying to connect
87+
where it is supposed to. If there is in fact no postmaster
88+
running there, the kernel error message will typically be either
89+
"Connection refused" or "No such file or directory", as illustrated.
90+
(It is particularly important to realize that "Connection refused" in
91+
this context does <emphasis>not</emphasis> mean that the postmaster
92+
got your connection request and rejected it --- that case will produce
93+
a different message, as shown below.)
94+
Other error messages such as "Connection timed out" may indicate more
95+
fundamental problems, like lack of network connectivity.
96+
</para>
97+
98+
<para>
99+
<ProgramListing>
100+
No pg_hba.conf entry for host 123.123.123.123, user joeblow, database testdb
101+
</ProgramListing>
102+
This is what you are most likely to get if you succeed in contacting
103+
a postmaster, but it doesn't want to talk to you. As the message
104+
suggests, the postmaster refused the connection request because it
105+
found no authorizing entry in its pg_hba.conf configuration file.
106+
</para>
107+
108+
<para>
109+
<ProgramListing>
110+
Password authentication failed for user 'joeblow'
111+
</ProgramListing>
112+
Messages like this indicate that you contacted the postmaster, and it's
113+
willing to talk to you, but not until you pass the authorization method
114+
specified in the pg_hba.conf file. Check the password you're providing,
115+
or check your Kerberos or IDENT software if the complaint mentions
116+
one of those authentication types.
117+
</para>
118+
119+
<para>
120+
<ProgramListing>
121+
FATAL 1: SetUserId: user 'joeblow' is not in 'pg_shadow'
122+
</ProgramListing>
123+
This is another variant of authentication failure: no Postgres create_user
124+
command has been executed for the given username.
125+
</para>
126+
127+
<para>
128+
<ProgramListing>
129+
FATAL 1: Database testdb does not exist in pg_database
130+
</ProgramListing>
131+
There's no database by that name under the control of this postmaster.
132+
Note that if you don't specify a database name, it defaults to your
133+
Postgres username, which may or may not be the right thing.
134+
</para>
23135

24-
it means that the site administrator started the <Application>postmaster</Application>
25-
as the wrong user. Tell him to restart it as
26-
the <ProductName>Postgres</ProductName> superuser.
27-
</Para>
28136
</sect1>
29137

30138
<sect1>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp