mingzaily opened a new issue, #1028:
URL: https://github.com/apache/rocketmq-clients/issues/1028

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq-clients/discussions).
   
   - [x] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq-clients/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq-clients/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [x] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Programming Language of the Client
   
   Go
   
   ### Runtime Platform Environment
   
   macOS 15.5
   
   ### RocketMQ Version of the Client/Server
   
   5.1.12
   
   ### Run or Compiler Version
   
   _No response_
   
   ### Describe the Bug
   
   The current RocketMQ Go client initializes its logging system using 
os.Getenv("user.home") to determine the user's home directory. In certain 
environments (containers, CI/CD pipelines, or specific IDE debugging sessions), 
this environment variable may not exist, causing the client to attempt creating 
a /logs folder in the system root directory, which fails due to permission 
issues.
   
   ### Steps to Reproduce
   
   ```golang
   producer, err := golang.NewProducer(&golang.Config{
        Endpoint: cfg.Endpoint,
        Credentials: &credentials.SessionCredentials{
                AccessKey:    cfg.AccessKey,
                AccessSecret: cfg.SecretKey,
        },
   })
   if err != nil {
        return nil, fmt.Errorf("failed to create rocketmq producer: %w", err)
   }
   
   if err := producer.Start(); err != nil {
        return nil, fmt.Errorf("failed to start producer: %w", err)
   }
   ```
   
   ### What Did You Expect to See?
   
   normal log file
   
   ### What Did You See Instead?
   
   ```log
   2025-06-30 15:11:29.388166 +0800 CST m=+146.273243918 write error: can't 
make directories for new logfile: mkdir /logs: read-only file system
   2025-06-30 15:11:29.388517 +0800 CST m=+146.273595334 write error: can't 
make directories for new logfile: mkdir /logs: read-only file system
   2025-06-30 15:11:29.388639 +0800 CST m=+146.273716834 write error: can't 
make directories for new logfile: mkdir /logs: read-only file system
   ```
   
   ### Additional Context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to