bitflicker64 opened a new issue, #3004:
URL: https://github.com/apache/hugegraph/issues/3004

   ### Bug Type (问题类型)
   
   other exception / error (其他异常报错)
   
   ### Before submit
   
   - [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 
[FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have 
confirmed and searched that there are no similar problems in the historical 
issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: latest master
   - Backend: any
   - OS: CentOS 7.8 (reported), affects any OS with lsof
   
   ### Expected & Actual behavior (期望与实际表现)
   
   Starting hugegraph-server produces the following error:
   
   lsof: unacceptable port specification in: -i :
   Starting HugeGraphServer in daemon mode...
   
   Root cause:
   check_port() in util.sh extracts the port using:
   
     local port=$(echo "$1" | awk -F':' '{print $3}')
   
   This assumes a 3-part URL like http://host:port. Since #2944 
   removed the http:// prefix from the default config, restserver.url 
   now defaults to 127.0.0.1:8080 (no scheme). Splitting on : gives 
   only 2 fields, so $3 is empty and lsof -i : is called with no port.
   
   Note: check_port accidentally works for gremlin because its fallback 
   hardcodes http://127.0.0.1:8182 — only the REST URL is broken.
   
   The same broken check_port exists in all three util.sh files:
   - hugegraph-server/.../bin/util.sh line 84
   - hugegraph-pd/.../bin/util.sh line 86  
   - hugegraph-store/.../bin/util.sh line 85
   
   Though only hugegraph-server actively calls it.
   
   Fix: replace the awk expression with:
   
     local port=$(echo "$1" | sed 's|.*:||' | sed 's|/.*||')
   
   This correctly handles all URL formats:
   - 127.0.0.1:8080       → 8080 ✓
   - http://127.0.0.1:8080 → 8080 ✓
   - http://127.0.0.1:8080/ → 8080 ✓
   - http://[::1]:8080    → 8080 ✓
   
   Related: #2944 (changed default restserver.url format, exposing this bug)
   Reported in: #3001
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   ```javascript
   
   ```
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to