Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Do not throw an `ApiException` when grpc logging does not work

Open
#4,707 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
grpc, php
Domain
api, backend

Research direction

Start with a PHP sample that uses grpc and the php.ini settings shown, comparing a writable and unwritable grpc.log file. Check the related grpc issue for the upstream behavior; done means the missing or unwritable log is reported descriptively rather than as an ApiException.

Written by the indexing model from the issue text.

Description

type: feature request

When debugging grpc-related issues in a PHP client library, some common steps include adding the below lines to the php.ini file:

grpc.grpc_verbosity=debug
grpc.grpc_trace=all,-timer_check
grpc.log_filename=/var/log/grpc.log

However, if one accidentally forgets to initialize and make the grpc.log file writeable (e.g. running sudo chmod 666 /var/log/grpc.log), then when running any sample PHP code that uses grpc, you get this error:

PHP Fatal error:  Uncaught Google\ApiCore\ApiException: {
    "message": "failed to connect to all addresses",
    "code": 14,
    "status": "UNAVAILABLE",
    "details": []
}

This is misleading as it suggests that the service one is trying to access in unavailable, when in actuality the only issue is that the grpc.log file is missing/unwriteable.

This error immediately goes away when the grpc.log file is initialized and writeable, or if grpc.log_filename is removed/commented out and the logs are written directly to stderr.

Ideally in this scenario, grpc emits a more descriptive message along the lines of Make sure the grpc.log file is initialized and writeable, and google-cloud-php does not throw an ApiException that could throw off users.

Related issue in grpc here: https://github.com/grpc/grpc/issues/27987

Dominant language
PHP
Stars
1.2k
Forks
464
Avg merge
2d 2h
Merged PRs (30d)
103

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-php

All issues in googleapis/google-cloud-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.