error starting container: API error (404): network fabric_test not found“

1. The fabric version used is v2.2.4. Test the test network

2. Problem description

When calling the basic chain code, the following error messages are found:
error: Endorsement failure during invoke. Response: status: 500 message: “error in simulation: failed to execute transaction 75a77550b68a7476882e7a512fa0dd4f0accd90e9f1db7e5193c914dd91bb285: could not launch chaincode basic_ 1.0:3cfcf67978d6b3f7c5e0375660c995b21db19c4330946079afc3925ad7306881: error starting container: error starting container: API error (404): network fabric_ test not found”

This fabric_test has different results according to different versions.
the essence is that the name of the started fabric network is wrong, which is inconsistent with the configuration in our. Yaml file and the docker compose

3. The solution is as follows:

Premise: after I have finished the./network up createChannel and the chain code, the chain code will come up. Do not do the following instructions directly after down!!!!!

3.1 first, we execute the following commands:

docker network ls

The display result is

3.2 open the test network/docker/docker-compose-test-net.yaml file
see

you can find that the name here is incorrect and you need to modify it to the docker displayed by docker network ls_ test。
note that in this file

CORE_ VM_ DOCKER_ HOSTCONFIG_ NETWORKMODE=fabric_ Test
there are two places, so we need to change two places.

After modification, it can be called successfully.

Read More: