This document provides some common issues. You can also go to feedback to check if the issue already exists. If you cannot find answers, submit an issue in feedback. Why Pipeline Not Triggered
To locate the pipeline trigger issue, you need to understand the process from trigger to execution.
Take the push event as an example:
flowchart LR
commit(git commit) --> push(git push) --> config(CI reads .cnb.yml under the corresponding branch) --> event(retrieves push event configuration for the branch) --> skip(skip detection) --> pipeline execution
Among them, skip detection includes ifNewBranch, ifModify. See syntax. Check by this process step by step:
1. Whether the code is pushed to the remote end.
2. Check whether there is a corresponding branch for .cnb.yml.
3. Whether a push event flow is configured.
4. Whether it hits the skip detection.
Running Normally Locally, Why Does It Fail to Run on CI
Start by clarifying the difference between the local environment and CI environment:
|
Network | Local network (such as some office intranet) | CI machine network location |
File | all files in local directory | Git repository branch code |
Environment | native | Specified Docker container environment |
Shell | Local specify | sh |
Learn about the differences, we can troubleshoot sequentially:
1. Whether the resource can be accessed only via the local intranet.
2. Whether there is an unsubmitted file.
3. Check whether the build dependency file hits .gitignore.
4. Run the same mirror locally to get the same build environment as CI and debug.
The default image for Cloud Native Build is cnbcool/default-build-env. So, we can execute the following command to enter the default CI environment and debug. Note:
Note: If other images are declared as the build pipeline environment, replace cnbcool/default-build-env in the command with the corresponding image address.
docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) cnbcool/default-build-env sh
Pipeline Execution Script and Logon Debug Script Results Differ: What Should Be Done
The pipeline uses sh by default, while logging in for debugging uses bash.
If the specified pipeline container supports bash (by default, pipeline containers support it, but custom containers may not), you can change the script execution to bash xxx.sh or bash -c '{original statement}'.
Timeout with No Log Output: How to Handle
A job will be terminated if it exceeds 10 minutes without log output. Consider adding logs, such as targeting npm install, you can add the verbose parameter.
Note:
The above scenario is different from the timeout declared in the job and cannot be modified via configuration.
Why Pipeline Failed Without Code Changes
Check dependencies and other resources for changes, for example:
Plug-in task declares the mirror version as latest. Check whether there is a change in the mirror.
The CI configuration file references other warehouse files. Check whether the referenced files have changed.
Network fluctuations may occur. Try Rebuild.