I'm trying to mup deploy the todos example of Meteor to a Vagrant VM running Ubuntu 14.04 LTS x64.
Meteor Up supports Windows (I'm on Windows 7):
You can use install and use Meteor Up from Linux, Mac and Windows.
This is my c:\code\todos\mup.json:
{
"servers": [
{
"host": "127.0.0.1",
"port": 2222,
"username": "vagrant",
"password": "vagrant"
}
],
"setupMongo": true,
"setupNode": true,
"nodeVersion": "0.12.4",
"setupPhantom": true,
"enableUploadProgressBar": false,
"appName": "todos-app",
"app": "/code/todos",
"env": {
"ROOT_URL": "http://127.0.0.1",
"PORT": "3001", // The port you want to bind to on your server.
"UPSTART_UID": "vagrant" // The user you want to run meteor as.
},
"deployCheckWaitTime": 30
}
My Vagrant VM is up and PuTTYTray is connected via vagrant:vagrant#127.0.0.7:2222. Yet mup deploy fails:
C:\code\todos>mup deploy
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
" Checkout Kadira!
It's the best way to monitor performance of your app.
Visit: https://kadira.io/mup "
Building Started: /code/todos
? Can't build for mobile on Windows. Skipping the following platforms:
android, ios
Started TaskList: Deploy app 'todos-app' (linux)
[127.0.0.1] - Uploading bundle
events.js:85
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED
at exports._errnoException (util.js:746:11)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
Same for mup setup. And in the VM mup deploy encounters a "weird error".
Should I downgrade mup?
Downgrading mup doesn't help:
C:\code\todos>npm install -g mup#0.9.7
C:\Users\Cees.Timmerman\AppData\Roaming\npm\mup -> C:\Users\Cees.Timmerman\AppData\Roaming\npm\node_modules\mup\bin\mup
mup#0.9.7 C:\Users\Cees.Timmerman\AppData\Roaming\npm\node_modules\mup
├── colors#0.6.2
├── underscore#1.7.0
├── uuid#1.4.2
├── async#0.9.2
├── rimraf#2.4.0 (glob#4.5.3)
├── cjson#0.3.1 (jsonlint#1.6.0)
└── nodemiral#0.3.11 (debug#0.7.4, ejs#0.8.8, handlebars#1.0.12)
C:\code\todos>mup -v
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
sshpass required for password based authentication: refer http://git.io/_vHbvQ
C:\code\todos>mup deploy
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
sshpass required for password based authentication: refer http://git.io/_vHbvQ
SSHPass doesn't work on Windows.
Manually setting up my Meteor app worked with help from this answer.
Related
I have 2 gcp projects pool-infra pool-dev. I use a github action to run a mvn command the configuration look like this...
- name: Authenticate with pure-infra project
uses: 'google-github-actions/auth#v0.8.1'
with:
service_account: my#pool-infra.iam.gserviceaccount.com
workload_identity_provider: projects/<pool-infra-id>/locations/global/workloadIdentityPools/....
token_format: 'access_token'
project_id: pure-platform-dev
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud#v1'
with:
project_id: pool-app
- name: Run Package
working-directory: my-service
run: |
gcloud config set project pool-app
gcloud config get project
mvn clean package jacoco:report
But I see an error that suggests the project ID is incorrect...
"errors": [
{
"domain": "usageLimits",
"message": "Cloud SQL Admin API has not been used in project <pool-infra-num> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview?project=<pool-infra-num> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason": "accessNotConfigured",
"extendedHelp": "https://console.developers.google.com"
}
],
I would expect those project nums to be for pool-app not infra. What am I missing? How do I properly set the project for the mvn project?
This is coming from the JDBC connection pool when it tries to connect.
I used ganache-cli in combination with my Infura key to fork ETH mainnet so I could use the Uniswap router in my development environment:
ganache-cli --fork https://mainnet.infura.io/v3/<mykeyhere>
This starts my local ganache blockchain without any errors. However when I deploy my contract with truffle:
truffle(development)> deploy
I keep getting the following error:
Compiling your contracts...
===========================
✓ Fetching solc version list from solc-bin. Attempt #1
✓ Fetching solc version list from solc-bin. Attempt #1
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/MollyCoin.sol
> Artifacts written to /home/dogperson/Code/MollyCoin/build/contracts
> Compiled successfully using:
- solc: 0.6.12+commit.27d51765.Emscripten.clang
UnhandledRejections detected
Promise {
<rejected> CodedError: Given input "NaN" is not a number.
at /home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/handlers/base-handler.js:174:23
at process.promise (internal/process/task_queues.js:97:5)
at ProviderHandler.queueRequest (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/handlers/base-handler.js:178:36)
at ProviderHandler.request (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/handlers/provider-handler.js:58:9)
at earliestBlock (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/persistent-cache/helpers.js:149:5)
at previousClosestAncestor (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/persistent-cache/helpers.js:77:19)
at PersistentCache.cache [as initialize] (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/persistent-cache/persistent-cache.js:142:47)
at Fork.cache [as initCache] (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/fork.js:209:21)
at Fork.fallback [as initialize] (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/fork.js:206:13)
at Blockchain.async [as initialize] (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/blockchain.js:629:22)
at EthereumProvider.async [as initialize] (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/provider.js:195:5)
at Connector.connect (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/connector.js:49:5) {
code: -32000
}
} CodedError: Given input "NaN" is not a number.
at /home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/handlers/base-handler.js:174:23
at process.promise (internal/process/task_queues.js:97:5)
at ProviderHandler.queueRequest (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/handlers/base-handler.js:178:36)
at ProviderHandler.request (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/handlers/provider-handler.js:58:9)
at earliestBlock (/home/dogperson/.nvm/versions/node/v12.22.9/lib/node_modules/truffle/node_modules/ganache/dist/node/webpack:/Ganache/chains/ethereum/ethereum/lib/src/forking/persistent-cache/helpers.js
The contract deploys just fine if I run ganache-cli without --fork. Also if I connect Remix to my forked ganache-cli through Metamask, I am also able to deploy and interact with the contract just fine, which makes me believe that the issue might be with truffle.
Extra info:
Truffle version: 5.5.13
Truffle config file
I tried to do the same thing as you and encountered the same error.
After some research I believe the issue is that ganache is read-only when used to fork mainnet (or any testnet). You can't make any transactions. Only calls.
I was able to achieve the objective by using Hardhat instead of ganache.
First I installed hardhat and initialized the sample project:
https://hardhat.org/guides/project-setup.html
Then I ran hardhat with:
npx hardhat node --fork "https://mainnet.infura.io/v3/<ACCOUNT>"
Then I ran "truffle console" in a separate terminal window, with the following lines in truffle-config.js:
const HDWalletProvider = require('#truffle/hdwallet-provider');
const mnemonic = "test test test test test test test test test test test junk";
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
provider: () => new HDWalletProvider(mnemonic, "http://127.0.0.1:8545"),
}
}
}
The mnemonic I used is "test test test test test test test test test test test junk" because that is Hardhat's default mnemonic and I was not immediately able to figure out how to configure Hardhat with a different mnemonic.
Before running the truffle console, remember to install the hdwalletprovider npm package in your truffle directory: https://www.npmjs.com/package/#truffle/hdwallet-provider
At this point I have a running truffle console connected to local hardhat process which is connected to infura. I can make transactions to deploy and interact with contracts.
Hope this helps, and good luck.
While trying to install puppeteer with: npm i puppeteer getting this error. My Node version is v12.16.3. I'm on a windows machine.
<!-- language: lang-none -->
ERROR: Failed to set up Chromium r756035! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:608:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1514:19)
at Object.onceWrapper (events.js:416:28)
at TLSSocket.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
-- ASYNC --
at BrowserFetcher.<anonymous> (C:\Users\Red Viper\AppData\Roaming\npm\node_modules\puppeteer\lib\helper.js:116:19)
at fetchBinary (C:\Users\Red Viper\AppData\Roaming\npm\node_modules\puppeteer\install.js:148:8)
at download (C:\Users\Red Viper\AppData\Roaming\npm\node_modules\puppeteer\install.js:54:9) {
code: 'ECONNRESET',
path: null,
host: 'storage.googleapis.com',
port: 443,
localAddress: undefined
}
use --unsafe-perm
It works for me!
npm i puppeteer -g --unsafe-perm
Run following command from terminal:
Mac:
export PUPPETEER_SKIP_DOWNLOAD='true'
Windows:
SET PUPPETEER_SKIP_DOWNLOAD='true'
Both will set environment variable and you should be fine with execution
For me, the reason was that this address was banned in my country. I had to use a proxy to avoid this error.
Probably you're behind a proxy, may be you can contact your network/security admin in your organization.
This was the case for me, and the issue didn't appear in my home network.
I have installed Docker Desktop for windows Docker version 18.09.2, build 6247962, and I'm not able to build and image. Even a docker search does not seem to work.
The error message (for example, when doing a docker search) is:
Error response from daemon: Get https://index.docker.io/v1/search?q=ubuntu&n=25: proxyconnect tcp: dial tcp 172.17.14.133:3128: connect: no route to host
My office is behind a proxy. So on the "Proxies" settings of DockerDesktop I set http://172.17.14.133:3128 for both HTTP and HTTTPS. But it still does not seem to work.
I have defined some ENV variables (both user and system) like this:
HTTPS_PROXY=http://proxypmi.tradyso.com:3128
HTTP_PROXY=http://proxypmi.tradyso.com:3128
Also:
C:\Users\my.user\AppData\Roaming\Docker\http_proxy.json:
{
"http": "http://172.17.14.133:3128",
"https": "http://172.17.14.133:3128",
"exclude": null,
"transparent_http_ports": [],
"transparent_https_ports": []
}
C:\Users\my.user\AppData\Roaming\Docker\settings.json:
{
"settingsVersion": 1,
"autoStart": false,
"checkForUpdates": true,
"analyticsEnabled": false,
"displayedWelcomeWhale": true,
"displayed14393Deprecation": false,
"displayRestartDialog": true,
"displaySwitchWinLinContainers": true,
"latestBannerKey": "",
"debug": false,
"memoryMiB": 2048,
"swapMiB": 1024,
"cpus": 2,
"diskPath": null,
"diskSizeMiB": 64000000000,
"networkCIDR": "10.0.75.0/24",
"proxyHttpMode": true,
"overrideProxyHttp": "http://172.17.14.133:3128",
"overrideProxyHttps": "http://172.17.14.133:3128",
"overrideProxyExclude": null,
"useDnsForwarder": true,
"dns": "10.44.24.10",
"kubernetesEnabled": false,
"showKubernetesSystemContainers": false,
"kubernetesInitialInstallPerformed": false,
"cliConfigCreationDate": "03/22/2019 12:23:58",
"linuxDaemonConfigCreationDate": "03/22/2019 12:22:19",
"windowsDaemonConfigCreationDate": null,
"versionPack": "default",
"sharedDrives": {},
"executableDate": "",
"useWindowsContainers": false,
"swarmFederationExplicitlyLoggedOut": false,
"activeOrganizationName": null,
"exposeDockerAPIOnTCP2375": false
}
C:\Users\my.user\.docker\config.json:
{
"stackOrchestrator": "swarm",
"auths": {},
"credsStore": "wincred",
"proxies":
{
"default":
{
"httpProxy": "http://172.17.14.133:3128",
"httpsProxy": "http://172.17.14.133:3128",
"noProxy": ""
}
}
}
I also tried passing build-arg to tocker build:
docker build --build-arg HTTP_PROXY=http://172.17.14.133:3128 --build-arg HTTPS_PROXY=http://172.17.14.133:3128 ...
Finally, on the Docker Desktop network configuration, I have tried with DNSs both "Automatic" and Manual (Using my corporate dns servers)
None of this has worked.
Any hint on what should I do?
Thank you.
A collegue found out the problem:
By default, the bridge network that docker creates uses the same subnet as our office (172.17.0.0/16) and that causes trouble with the proxy ip address (172.17.14.133).
To solve this:
[Edit]: for a simpler method, use the following:
On daemon configuration, add "bip": "new_subbet". For example: "bip": "172.19.0.1/16". Then, restart docker.
Now, you won't even need to pass the extra --network="docker_gwbridge" parameter to the commands.
This shorter solution may not work with older versions of Docker for windows, so you may consider the original answer if this option does not work.
[Edit]: original method for old versions of docker for windows:
The bridge network cannot be deleted, but We can tell docker not to create it.
Go to Daemon Settings, Advanced => add "bridge": "none", to the configuration
After applying changes, Docker will restart and now We will be able to create our own custom bridge network
In this example, We are going to use (172.19.0.0/16)
Open a console and write:
docker network create --subnet=172.19.0.0/16 --gateway 172.19.0.1 -o com.docker.network.bridge.enable_icc=true -o com.docker.network.bridge.name=docker_gwbridge -o com.docker.network.bridge.enable_ip_masquerade=true docker_gwbridge
Then we can do a docker ls for checking that the previous command was successful:
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
2a3635a49ffa docker_gwbridge bridge local
4e9ec758ee9f host host local
737c6c5fc82b none null local
Now do a docker search ubuntu (for example). It should be able to connect to the internet and fetch the images.
Important: From now on, some commands that need internet access will need to specify the new docker network with the extra parameter --network="docker_gwbridge"
For example a docker build command could be:
docker build --network="docker_gwbridge" --build-arg http_proxy=http://172.17.14.133:3128 --build-arg https_proxy=http://172.17.14.133:3128 -t foobar .
I can't manage to make my Phoenix 1.2 app to run on Heroku CI.
It seems it's trying to create a new database, and even though I configured an alias, it's still performing ecto.create.
Here is Heroku CI output:
-----> Running Elixir buildpack tests... 10:25:25.751 [warn] Warning: No valid AppSignal configuration found, continuing with AppSignal metrics disabled. 10:25:26.071 [error] GenServer #PID<0.903.0> terminating
** (Postgrex.Error) FATAL (insufficient_privilege): permission denied for database "template1" User does not have CONNECT privilege.
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3 Last message: nil
** (Mix) The database for PhenixDisplays.Repo couldn't be created: FATAL (insufficient_privilege): permission denied for database "template1" User does not have CONNECT privilege.
-----> Elixir buildpack tests failed with exit status 1
My mix.exs aliases function
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"test": ["ecto.migrate", "test"]
]
end
And my repo setup in test.exs
config :phenix_displays, PhenixDisplays.Repo,
adapter: Ecto.Adapters.Postgres,
url: System.get_env("DATABASE_URL") || "postgres://postgres:postgres#localhost:5432/phenix_displays_test",
pool: Ecto.Adapters.SQL.Sandbox,
extensions: [{Geo.PostGIS.Extension, library: Geo}, {PhenixDisplays.Postgrex.Box2D, []}]
It might be that mix ecto.setup is being called as part of the preparations to run your tests. HerokuCI seems to use an app.json file for configuration of your tests. This is an example I found at https://devcenter.heroku.com/articles/heroku-ci
{
"environments": {
"test": {
"scripts": {
"test-setup": "gem install rubocop",
"test": "rubocop ."
}
}
}
}
Make sure that the correct test-setup is configured and that it only runs the commands you want it to run.