The endpoint works when entered manually and fails when loaded from a file. Before rotating the password, inspect how the record is read.

A line-oriented file has a delimiter. If the parser leaves its trailing newline in the last field, the credential passed to the client can differ from the one you intended. Windows-style CRLF makes two bytes worth checking.

PHP's file() supports FILE_IGNORE_NEW_LINES for reading records without their line-ending delimiter. Use the behavior appropriate to the file's documented format.

Be careful with the popular follow-up fix: trim every field. Spaces can be real password characters. Removing all leading and trailing whitespace changes the credential rather than merely removing a record terminator.

Define the separators too. An informal colon-delimited format can become ambiguous when the password or an IPv6 address contains colons. Read the record according to that format, retain its intended password bytes, and only then encode components for an endpoint URL if required.

For diagnostics, compare lengths or controlled non-secret test values. Printing the real password or a full credential-bearing URL creates another problem while solving a very small parser error.

འབྲེལ་བའི་རྩོམ་ཡིག