复现 基于fabric的学历征信系统出现的问题——dep ensure 出现越界问题

教程地址 https://blog.csdn.net/weixin_44676392/article/details/88240505

###在进行2.5.1步骤 dep ensure报错

###已科学上网,是dep版本不对吗?

###请问如何解决?
图片说明

weixin_42208335
#闪闪惹人爱# 題主,請問你解決了嗎,我也遇到了這個問題
7 天之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

设置go dep后依赖关系出现问题

<div class="post-text" itemprop="text"> <p>My project is located in <code>$GOPATH/src/smp-cloudupload</code> </p> <p>I can run <code>dep init</code> without errors. After that I cant compile the project anymore. One of the errors:</p> <pre><code>main/scs/scsApiGateway.go:5:2: cannot find package "_/home/dev/go/src/smp-cloudupload/vendor/github.com/dgrijalva/jwt-go" in any of: /usr/lib/go-1.10/src/_/home/dev/go/src/smp-cloudupload/vendor/github.com/dgrijalva/jwt-go (from $GOROOT) /home/dev/go/src/_/home/dev/go/src/smp-cloudupload/vendor/github.com/dgrijalva/jwt-go (from $GOPATH) </code></pre> <p>I am new to GO and I have a feeling, that there are either issues with my project structure or the GOPATH. The shown path is wrong. The correct path is: <code>/home/dev/go/src/smp-cloudupload/vendor/github.com/dgrijalva/jwt-go</code></p> <p>What am I doing wrong?</p> <p><strong>EDIT:</strong></p> <p>Output of <code>echo $GOPATH</code>: dev@dev-VirtualBox:~/go/src/smp-cloudupload/main$ echo $GOPATH</p> <pre><code>/home/dev/go </code></pre> <p>I have no idea why there is a underscore in the path. The actual path of my project contains no underscores</p> </div>

新的Ubuntu设置Golang + dep,dep确保不执行任何操作

<div class="post-text" itemprop="text"> <p>I'm having an annoying problem and I can't find what the problem is. I'm quite new to Ubuntu/Golang/dep but I'm trying to understand how it works.</p> <p>I have a source project, with the vendor files, when I run the command <code>dep ensure</code>, nothing happens, the cli just keeps running, no error message or any normal message, command is running for 30 minutes now and nothing happens.</p> <p>For specific reasons I can't share anything about the project itself. For all I know, the files of the projects shouldn't be the problem.</p> <p>The version of golang and dep are both the latest version.</p> <p>The path to the go bin and dep bin has been set in the <code>.profile</code>, together with the exportating of the GOPATH path.</p> </div>

使用dep时强制特定版本的依赖项

<div class="post-text" itemprop="text"> <p>I am using <em>dep</em> to manage the dependencies of a Go tool I'm writing.</p> <p>This tool uses <a href="https://github.com/desertbit/grumble" rel="noreferrer">https://github.com/desertbit/grumble</a> as an dependency. This in turn uses <a href="https://github.com/chzyer/readline" rel="noreferrer">https://github.com/chzyer/readline</a> as a dependency. The problem is that when trying to run my tool I get the following error: <code> vendor/github.com/desertbit/grumble/app.go:295:20: unknown field 'HistorySearchFold' in struct literal of type readline.Config </code></p> <p>I know why this is happending. <em>grumble</em> uses the <em>master</em> branch of <em>readline</em> as a dependency. In this the field <code>HistorySearchFold</code> is available. When using <code>dep init</code>/<code>dep ensure</code> not the <em>master</em> but the <em>1.4</em> tag is pulled into the vendor folder. </p> <p>My question therefore is: How can I force <em>dep</em> to pull the <em>master</em> branch instead?</p> <p>I tried adding the following in my Gopkg.toml file:</p> <pre><code>[[constraint]] branch = "master" name = "github.com/chzyer/readline" </code></pre> <p>Sadly this is not working. When I check the version pulled into the vendor folder it is still <em>1.4</em>.</p> </div>

dep sure失败,解决失败:无法清理git repository。

<div class="post-text" itemprop="text"> <p>I am trying to import the go repo <code>https://github.com/cloudfoundry/cli</code></p> <p>My <code>dep init</code> or <code>dep ensure</code> commands fail when I add the import statement in my go program. </p> <p>I am not sure what is the reason I am not able to get the repo. I can do a <code>git clone</code> in the go/src and it complains that the local version might be inconsistent. </p> <p>Not sure what is happening with this particular repo. </p> <pre><code>bash-3.2$ dep ensure Solving failure: failed to clean up git repository at /Users/rjain/go/pkg/dep/sources/https---github.com-cloudfoundry-cli - dirty? corrupted? status output: D VERSION </code></pre> </div>

如何获取Dep确保删除未使用的Go文件,依赖项或软件包

<div class="post-text" itemprop="text"> <p>When adding new dependencies using <code>dep ensure -add &lt;package&gt;</code> I see <code>dep</code> adding the complete repository of the package, instead of just the parts I require.</p> <p>For example I added <a href="https://github.com/aws/aws-sdk-go" rel="nofollow noreferrer">aws-sdk-go</a> and <code>dep ensure</code> put 87MB of files into my vendors folder, even though I only use the AWS Secrets Manager service.</p> </div>

dep和bazel Go规则之间是否有联系?

<div class="post-text" itemprop="text"> <p>Intro: <a href="https://github.com/golang/dep" rel="nofollow noreferrer">dep</a> is a tool to manage dependencies of Go projects. <a href="https://bazel.build/" rel="nofollow noreferrer">bazel</a> is a build tool that produces stable, reproducable builds. There is a bazel <a href="https://github.com/bazelbuild/rules_go" rel="nofollow noreferrer">rule set for Go projects</a>, including an automatic build-file generator, <em>gazelle,</em> that generates Bazel build files following the conventions that <code>go build</code> would apply, using the dependencies declared in the bazel <code>WORKSPACE</code>.</p> <p>The <code>WORKSPACE</code>, though, I have to create by hand or by help of a little hackish helper tool, <code>wtool</code>. <code>dep</code>, on the other hand, helps track dependencies, is able to download them into a <code>vendor/</code> directory and locking specific versions. </p> <p>To me it appears that the <code>Gopkg.lock</code> file that dep uses to specify versions of dependencies (usually by their VCS commit hash) would be easily translated into a bazel <code>WORKSPACE</code> file. I have successfully done so manually in a company-internal project as well. </p> <p>Is there an existing link between bazel and its Go rules and dep that I could have used instead of doing this manually?</p> <p><em>(Additionally: Is anybody else doing this? Should I be doing this at all?)</em></p> </div>

即使程序包存在,Dep init也会失败

<div class="post-text" itemprop="text"> <p>I am trying to package a <code>go</code> application using <code>dep</code> and when doing <code>dep init</code> the below error occours.</p> <p>I have installed the <code>amcl</code> library from here - <a href="https://github.com/milagro-crypto/amcl/tree/master/version3/go" rel="nofollow noreferrer">https://github.com/milagro-crypto/amcl/tree/master/version3/go</a></p> <p>Even the following packages exists</p> <pre><code>nithin@XPS-L401X:~/go/src/github.com/milagro-crypto/amcl/version3/go/amcl/FP256BN$ ls ARCH.go BIG.go DBIG.go ECDH.go ECP2.go ECP.go FP12.go FP2.go FP4.go FP.go MPIN.go PAIR.go ROM.go </code></pre> <p>But still i get the following error</p> <pre><code>init failed: unable to solve the dependency graph: Solving failure: No versions of github.com/milagro-crypto/amcl met constraints: 281d0829b307c911bb2f14f2fedc414a257cb8c8: Could not introduce github.com/milagro-crypto/amcl@281d0829b307c911bb2f14f2fedc414a257cb8c8 due to multiple problematic subpackages: Subpackage github.com/milagro-crypto/amcl/version3/go/amcl/FP256BN is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) Subpackage github.com/milagro-crypto/amcl/version3/go/amcl is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) master: Could not introduce github.com/milagro-crypto/amcl@master due to multiple problematic subpackages: Subpackage github.com/milagro-crypto/amcl/version3/go/amcl is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) Subpackage github.com/milagro-crypto/amcl/version3/go/amcl/FP256BN is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) add-js-tests: Could not introduce github.com/milagro-crypto/amcl@add-js-tests due to multiple problematic subpackages: Subpackage github.com/milagro-crypto/amcl/version3/go/amcl is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) Subpackage github.com/milagro-crypto/amcl/version3/go/amcl/FP256BN is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) fix-retval: Could not introduce github.com/milagro-crypto/amcl@fix-retval due to multiple problematic subpackages: Subpackage github.com/milagro-crypto/amcl/version3/go/amcl is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) Subpackage github.com/milagro-crypto/amcl/version3/go/amcl/FP256BN is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) milagro-crypto-c: Could not introduce github.com/milagro-crypto/amcl@milagro-crypto-c due to multiple problematic subpackages: Subpackage github.com/milagro-crypto/amcl/version3/go/amcl/FP256BN is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) Subpackage github.com/milagro-crypto/amcl/version3/go/amcl is missing. (Package is required by github.com/hyperledger/fabric@release-1.1.) </code></pre> </div>

如何使用由dep管理的开发供应商软件包?

<div class="post-text" itemprop="text"> <p>How can I use a development copy/clone of a package while using <code>dep</code> and a vendor directory? The vendor directory is included in the main repository.</p> <p>For example, I have forked package and replaced it with my own on github. I want to be able to edit the code and not have to <code>git push</code> + <code>dep ensure</code> for each change of the package.</p> <p>If I clone the package in the vendor directory, it I won't be able to commit that directory into the main repo because it's treated as a separate repository.</p> <p>I tried a trick to <code>.gitignore</code> the <code>.git</code> directory from outside the package. This works well until <code>dep ensure</code> is run, where the <code>.git</code> directory is nuked.</p> </div>

Golang Dep无法读取元数据:找不到导入的元数据

<div class="post-text" itemprop="text"> <p>I am transitioning over to use golang Dep <a href="https://github.com/golang/dep" rel="nofollow noreferrer">https://github.com/golang/dep</a></p> <p>We have repositories for microservices that use a common code base.</p> <p>Its hosted at git.corp.company.com/Organization/common-base</p> <p>in vendor base we have a projects structure as follows</p> <pre><code>vendor git.corp.company.com Organization common-base github.com ... online dependencies like aws, garyburd, etc... golang.org X sys text </code></pre> <p>When I try to do dep init, I get an error message like </p> <p><code>unable to deduce repository and source type for "git.corp.company.com/Organization/common-base": unable to read metadata: go-import metadata not found</code></p> <p>I'm not sure why that is happening and what to do next. Do I need to add in the metadata file to our common code?</p> </div>

Go Dep-与供应商同步Gopkg.toml

<div class="post-text" itemprop="text"> <p>Is there a way to create or sync <code>Gokpkg.toml</code> with the packages that i import in my <code>.go</code> files? If my <code>Gopkg.toml</code> is empty and I run <code>dep ensure</code>, it would download all the packages that I import in my code to the <code>vendor</code> folder but it won't update the <code>Gopkg.toml</code> file. It came up when I had to migrate a legacy project that didn't use a package manager to using <code>dep</code> in the simplest way possible by just creating a <code>Gopkg.toml</code> that contains the latest version of all the packages that I already import instead of running <code>dep ensure -add ...</code> manually for every package. Is there such command?</p> </div>

去Dep不在docker-compose上运行

<div class="post-text" itemprop="text"> <p>My problem is docker-compose always return: </p> <p><code>golang_1 | bash: dep: command not found</code></p> <p>It's my <code>docker-compose.yml</code> :</p> <pre><code> version: "3" services: postgres: image: postgres environment: POSTGRES_USER: mini_api POSTGRES_PASSWORD: p4ssw0rd POSTGRES_DB: mini-api volumes: - ./db.sql:/docker-entrypoint-initdb.d/db.sql ports: - "5433:5432" golang: image: golang:1.11.0-stretch volumes: - ./:$GOPATH/src/github.com/bagusandrian/mini-api working_dir: $GOPATH/src/github.com/bagusandrian/mini-api links: - postgres ports: - "8000:9090" command: bash -c "dep ensure -v &amp;&amp; go build -v &amp;&amp; ./mini-api" </code></pre> <p>I run with command: <code>docker-compose up</code> and always return:</p> <pre><code>golang_1 | bash: dep: command not found </code></pre> <p>Any false in my <code>docker-compose.yml</code> or I missing something? </p> <p>You can pull from my repo: <a href="http://github.com/bagusandrian/mini-api" rel="nofollow noreferrer">http://github.com/bagusandrian/mini-api</a></p> </div>

忽略并阻止使用go dep删除供应商的软件包?

<div class="post-text" itemprop="text"> <p>I have a bit of an issue, I have a Go project that I depend on (DPkg) and this project has some small dependency on another package (TPkg).</p> <p>For some reasons which is irrelevant to the question I am not able to build TPkg at the moment however I know that I do not ever use the parts of DPkg that call TPkg so I went ahead and recreated a fake DPkg in my vendor folder.</p> <p>The issue is that whenever I run <code>dep ensure</code>, dep will attempt to handle this package. I have attempted setting an <code>ignored</code> constraint on it in my Gopkg.toml but then dep just deletes my code in the vendor folder. I have also tried further adding a <code>prune.project</code> constraint to mark TPkg as <code>unused-packages = false</code> but that does not prevent dep from deleting the package.</p> <p>Is there any way that I can tell dep to <em>ignore TPkg completely</em> and by that I mean, don't attempt to change it or delete it?</p> <p>I <strong>know</strong> what this means and how bad it is in terms of issues and maintainability but that is not the question at hand here. </p> </div>

Golang Dep无法读取元数据

<div class="post-text" itemprop="text"> <p>I use this command:</p> <pre><code>dep init -gopath -v </code></pre> <p>in my gopath,like this:</p> <pre><code>gopath/src/aaa.com/bbb/ccc.v2 </code></pre> <p>in my code, import is:</p> <pre><code>import ("aaa.com/bbb/ccc.v2") </code></pre> <p>final got this:</p> <pre><code>init failed: unable to determine direct dependencies: unable to deduce repository and source type for "aaa.com/bbb/ccc.v2": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://aaa.com/bbb/ccc.v2?go-get=1": Get http://aaa.com/bbb/ccc.v2?go-get=1: context canceled </code></pre> <p>actually,aaa.com don`t exists,it just a dir in my gopath</p> <p>WHY dep still request the network to get metadata even if I specified the <code>-gopath</code> param?</p> </div>

ERROR: Error checking for conflicts.AttributeError: _DistInfoDistribution__dep_map;AttributeError: _pkg_info

当我从Anaconda打开Spyder时,收到这样一个报错: ![图片说明](https://img-ask.csdn.net/upload/202006/17/1592375414_741461.png) ``` you have missing dependencies #Mandatory pyls>=0.31.0;<0.32.0:0.1.6(NOK) please install them to aiod this message …… ``` 我试图用pip或者conda安装pyls板块,但得到了不同的报错: 使用pip时的报错—— ![图片说明](https://img-ask.csdn.net/upload/202006/17/1592375632_646303.png) ``` ERROR: Error checking for conflicts. Traceback (most recent call last): File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 3021, in _dep_map return self.__dep_map File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 2815, in __getattr__ raise AttributeError(attr) AttributeError: _DistInfoDistribution__dep_map During handling of the above exception, another exception occurred: Traceback (most recent call last): File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 3012, in _parsed_pkg_info return self._pkg_info File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 2815, in __getattr__ raise AttributeError(attr) AttributeError: _pkg_info During handling of the above exception, another exception occurred: Traceback (most recent call last): File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_internal\commands\install.py", line 509, in _warn_about_conflicts package_set, _dep_info = check_install_conflicts(to_install) File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_internal\operations\check.py", line 114, in check_install_conflicts package_set, _ = create_package_set_from_installed() File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_internal\operations\check.py", line 53, in create_package_set_from_installed package_set[name] = PackageDetails(dist.version, dist.requires()) File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 2736, in requires dm = self._dep_map File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 3023, in _dep_map self.__dep_map = self._compute_dependencies() File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 3032, in _compute_dependencies for req in self._parsed_pkg_info.get_all('Requires-Dist') or []: File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 3014, in _parsed_pkg_info metadata = self.get_metadata(self.PKG_INFO) File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1420, in get_metadata value = self._get(path) File "d:\anaconda\envs\tensorflow\lib\site-packages\pip-20.2b1-py3.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1616, in _get with open(path, 'rb') as stream: FileNotFoundError: [Errno 2] No such file or directory: 'd:\\anaconda\\envs\\tensorflow\\lib\\site-packages\\rsa-4.0.dist-info\\METADATA' ``` 使用conda时的报错—— ![图片说明](https://img-ask.csdn.net/upload/202006/17/1592375901_681838.png) ``` (tensorflow) C:\Users\wangl>conda install pyls Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): failed # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "D:\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 248, in _load repodata_fn=self.repodata_fn) File "D:\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 598, in fetch_repodata_remote_request raise Response304ContentUnchanged() conda.core.subdir_data.Response304ContentUnchanged ``` 请问一下,是什么原因导致了这种情况?是python和anaconda的冲突吗?我是直接在anaconda里安装的python,并没有单独安装?现在应该如何解决这个难题呢?

Golang使用带有dep的golang dep

<div class="post-text" itemprop="text"> <p>I use the go dep tool version v0.4.1, now when I run dep init it create 2 files as expected , when I open the <code>gopkg.lock</code> I found for example the following</p> <pre><code>[[projects]] name = "github.com/inconshreveable/mousetrap" packages = ["."] revision = "76626ae9c91c4f2a10f34cad8ce832c93bb75" version = "v1.0" </code></pre> <p>I dont use this im my source code, search it deeply also on vendor, so why it's there, what am I missing here ? if it transitive dep I need to find usage of it in vendor library, isnt it ? </p> </div>

使用aws-go-dep无法安装无服务器

<div class="post-text" itemprop="text"> <p>I'm just getting starting with Golang and Serverless. I've basically gone through these steps on MacOS:</p> <ol> <li>brew install golang</li> <li>brew install dep</li> <li>npm install -g serverless</li> <li>mkdir ~/Projects/testproject</li> <li>Added <code>export GOPATH="$GOPATH:~/Projects/testproject"</code> to <code>~/.profile</code></li> <li>serverless create -t aws-go-dep -p myservice within the testprojects folder</li> <li>Run make and get this weird error:</li> </ol> <pre><code>unable to create lock pkg/dep/sm.lock: Lockfiles must be given as absolute path names make: *** [build] Error 1 </code></pre> <p>Not sure what I'm doing wrong. Also I followed the blog article for getting setup with the example: <a href="https://serverless.com/blog/framework-example-golang-lambda-support/" rel="nofollow noreferrer">https://serverless.com/blog/framework-example-golang-lambda-support/</a></p> <p>According to <code>go env</code> my path is: <code>GOPATH=":/Users/ddibiase-macbook/go:/Users/ddibiase-macbook/Projects/centive/api"</code></p> <p>There isn't much helpful documentation online to get through this :-/</p> </div>

Hyperledger Fabric registerChaincodeEvent()方法未从链码获取事件

<div class="post-text" itemprop="text"> <p>After deploying my chaincode successfully and being able to perform some get from its data (all data returned are correct), I am not able to check if an event is emitted. The function inside <code>Invoke()</code> is <code>queryAllMachines()</code> and if I call just this function it returns a set of machines (the set of machine insert in the method InitLedger())</p> <p>I follow the documentation and my chaincode (in go) should emit an event in this code line inside its <code>queryAllMachines()</code> function:</p> <pre><code>func (s *testContract) queryAllMachines(APIstub shim.ChaincodeStubInterface) sc.Response { fmt.Println("inside queryAllMachines ") ... err = APIstub.SetEvent("evtsender", []byte("adadsads")) if err != nil { return shim.Error("event not set") } fmt.Printf("No errors ") } </code></pre> <p>This code always prints "no errors", so I suppose the events is emitted rightly.</p> <p>Then in my .js file for query i have the request:</p> <pre><code>let request = { chaincodeId: 'oraclize-test-integration', fcn: 'queryAllMachines', args: [''], txId: tx_object }; </code></pre> <p>Then this is the part of my .js file where I have the problem and where I want to launch <code>registerChaincodeEvent()</code>:</p> <pre><code>let event_monitor = new Promise((resolve, reject) =&gt; { let regid = null; let handle = setTimeout(() =&gt; { if (regid) { // might need to do the clean up this listener channel_event_hub.unregisterChaincodeEvent(regid); console.log('Timeout - Failed to receive the chaincode event'); } reject(new Error('Timed out waiting for chaincode event')); }, 20000); regid = channel_event_hub.registerChaincodeEvent('oraclize-test-integration', 'evtsender', (event, block_num, txnid, status) =&gt; { // This callback will be called when there is a chaincode event name // within a block that will match on the second parameter in the registration // from the chaincode with the ID of the first parameter. console.log('Successfully got a chaincode event with transid:' + txnid + ' with status:' + status); // might be good to store the block number to be able to resume if offline storeBlockNumForLater(block_num); // to see the event payload, the channel_event_hub must be connected(true) let event_payload = event.payload.toString('utf8'); if (event_payload.indexOf('CHAINCODE') &gt; -1) { clearTimeout(handle); // Chaincode event listeners are meant to run continuously // Therefore the default to automatically unregister is false // So in this case we want to shutdown the event listener once // we see the event with the correct payload channel_event_hub.unregisterChaincodeEvent(regid); console.log('Successfully received the chaincode event on block number ' + block_num); resolve('RECEIVED'); } else { console.log('Successfully got chaincode event ... just not the one we are looking for on block number ' + block_num); } }, (error) =&gt; { clearTimeout(handle); console.log('Failed to receive the chaincode event ::' + error); reject(error); } // no options specified // startBlock will default to latest // endBlock will default to MAX // unregister will default to false // disconnect will default to false ); }); // build the promise to send the proposals to the orderer let send_trans = channel.sendTransaction({ proposalResponses: query_responses[0], proposal: query_responses[1] }); // now that we have two promises all set to go... execute them return Promise.all([event_monitor, send_trans]); </code></pre> <p>The error that appears is: </p> <blockquote> <p>Timeout - Failed to receive the chaincode event (node:9180) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Timed out waiting for chaincode event (node:9180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with anon-zero exit code.</p> </blockquote> <p>So the functions times out in this part of the code, even if I launch another .js file that execute successfully the call to <code>queryAllMachines()</code> function: </p> <pre><code>let handle = setTimeout(() =&gt; { if (regid) { // might need to do the clean up this listener channel_event_hub.unregisterChaincodeEvent(regid); console.log('Timeout - Failed to receive the chaincode event'); } reject(new Error('Timed out waiting for chaincode event')); }, 20000); </code></pre> </div>

Dep init上的“不在已知的GOPATH / src中”错误

<div class="post-text" itemprop="text"> <p>When I run <code>dep init</code> in project folder, the error occurs:</p> <blockquote> <p>init failed: unable to detect the containing GOPATH: D:\projects\foo is not within a known GOPATH/src</p> </blockquote> <p>My projects are located on another drive and not <code>%GOPATH%/src</code> (i.e. <code>%USERPROFILE%\go\src</code>).</p> <p>It's a known error but it's unclear what is the solution.</p> <p>How can I use <code>dep</code> without moving Go projects to <code>%GOPATH%/src</code>?</p> </div>

使用go和dep的Heroku:“推送被拒绝:无法编译Go应用”

<div class="post-text" itemprop="text"> <p>I am trying to deploy my Go Heroku app that uses <code>dep</code> to manage dependencies. However, when I attempt to push it, the logs say this.</p> <pre><code>Total 818 (delta 147), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----&gt; Go app detected remote: -----&gt; Fetching jq... done remote: -----&gt; Fetching tq... done remote: !! remote: !! Deprecated or unsupported version of go (go1.10.1) remote: !! See https://devcenter.heroku.com/articles/go-support#go-versions for supported version information. remote: !! remote: -----&gt; Installing go1.10.1 remote: -----&gt; Fetching go1.10.1.linux-amd64.tar.gz... done remote: !! Installing package '.' (default) remote: !! remote: !! To install a different package spec set 'metadata.heroku.pkg-spec' in 'Gopkg.toml' remote: !! remote: !! For more details see: https://devcenter.heroku.com/articles/go-apps-with-dep#build-configuration remote: !! remote: -----&gt; Fetching dep... done remote: -----&gt; Fetching any unsaved dependencies (dep ensure) remote: -----&gt; Running: go install -v -tags heroku . remote: main.go:7:2: cannot find package "backend/database" in any of: remote: /tmp/tmp.2P0hB8CCKz/.go/src/main/vendor/backend/database (vendor tree) remote: /app/tmp/cache/go1.10.1/go/src/backend/database (from $GOROOT) remote: /tmp/tmp.2P0hB8CCKz/.go/src/backend/database (from $GOPATH) remote: main.go:6:2: cannot find package "backend/user" in any of: remote: /tmp/tmp.2P0hB8CCKz/.go/src/main/vendor/backend/user (vendor tree) remote: /app/tmp/cache/go1.10.1/go/src/backend/user (from $GOROOT) remote: /tmp/tmp.2P0hB8CCKz/.go/src/backend/user (from $GOPATH) remote: ! Push rejected, failed to compile Go app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to thindan. remote: </code></pre> <p>It nags and complains about a GOPATH that is already correct on my system. I wonder why this is happening? My dep configuration file looks like this.</p> <pre><code># Gopkg.toml example # # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] # # [[constraint]] # name = "github.com/user/project" # version = "1.0.0" # # [[constraint]] # name = "github.com/user/project2" # branch = "dev" # source = "github.com/myfork/project2" # # [[override]] # name = "github.com/x/y" # version = "2.4.0" [[constraint]] name = "github.com/boltdb/bolt" version = "1.3.1" [[constraint]] branch = "master" name = "golang.org/x/crypto" [metadata.heroku] root-package = "backend" go-version = "1.10.1" build = ["."] ensure = "false" </code></pre> <p>What is wrong, and how can I fix it?</p> </div>

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

相关热词 c#树形选择 c#中类图的使用方法 c# 传参 调用exe c# 怎么定义方法 c# 修改本地时间 c#前台怎么读取资源文件 c# xml转list c#实现框选截图 m*m乘法表c# c# 乘法99表
立即提问