Getting error while bootstrapping opensearch dashboard - windows

I am setting up opensearch dashboard in my windows PC and following below guide -
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md
While bootstrapping, I am getting below error -
PS D:\opensearch\OpenSearch-Dashboards> yarn osd bootstrap
yarn run v1.22.18
$ node scripts/osd bootstrap
info [opensearch-dashboards] running yarn
$ node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "typescript#4.0.2" is incompatible with requested version "typescript#~4.5.2"
success Already up-to-date.
succ yarn.lock analysis completed without any issues
succ 10 bootstrap builds are cached
info [#osd/i18n] running [osd:bootstrap] script
info [#osd/monaco] running [osd:bootstrap] script
info [#osd/opensearch-archiver] running [osd:bootstrap] script
info [#osd/opensearch] running [osd:bootstrap] script
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\st\AppData\Roaming\nvm\v14.18.2\node_modules\yarn\bin\yarn.js run osd:bootstrap
'rm' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
$ rm -rf target && tsc
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
at makeError (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:25150:11)
at handlePromise (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:24085:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:9051:9
at async scheduleItem (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:10938:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
what I see here is, rm command is not recognized in windows and which is correct.
So how to fix this ?

Related

go application build with bazel can't link when running inside container

I am trying to containerize my application build, though, when running the build that uses bazel with bazel-gazelle inside a container I will get this error:
$ bazel run --spawn_strategy=local //:gazelle --verbose_failures
INFO: Analyzed target //:gazelle (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/BUILD.bazel:43:15: GoToolchainBinary external/go_sdk/builder [for host] failed: (Exit 1): go failed: error executing command
(cd /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/execroot/__main__ && \
exec env - \
GOROOT_FINAL=GOROOT \
external/go_sdk/bin/go tool link -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a)
# Configuration: e0f1106e28100863b4221c55fca6feb935acec078da5376e291cf644e275dae5
# Execution platform: #local_config_platform//:host
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
Target //:gazelle failed to build
INFO: Elapsed time: 2.302s, Critical Path: 0.35s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
I tried to run it standalone:
$ /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/bin/go tool link -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
and still got no success.
Never had this kind of link problem and the linker don't provide much more information. Tried to install all packages I could think of and still no luck.
For context:
Running Ubuntu 20.04 LTS
Docker 20.10.9
Bazel 4.2.2
Rules GO v0.31.0
Bazel Gazelle v0.25.0
Also tried to run it with the strace, though I don't think I am skilled enough to find meaningful information from the tool output.
#edit
For more context:
e$ /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/bin/go tool link -v -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a
HEADER = -H5 -T0x401000 -R0x1000
searching for runtime.a in /opt/go/pkg/linux_amd64/runtime.a
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument

yarn deploy give error with Command failed with exit code 1 when running collection-examples-as

I am trying to run the collection-examples-as near example but when I run yarn deploy it gives me the following error
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: ENOENT: no such file or directory, open './contract.wasm'
[Error: ENOENT: no such file or directory, open './contract.wasm'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './contract.wasm'
}
error Command failed with exit code 1.
I think the error is it can't find the path to ./contract.wasm so I run yarn build the I tried to deploy it again using yarn deploy but I got another error which is:
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: Can not sign transactions for account dev-1637744501224-6323200 on network
default, no matching key pair found in
InMemorySigner(MergeKeyStore(UnencryptedFileSystemKeyStore(/home/rasha/.near-
credentials), UnencryptedFileSystemKeyStore(/home/rasha/collection-examples-
as/neardev))).
{
type: 'KeyNotFound',
context: undefined
}
any help or suggestions?
There's an issue with old versions of near-cli and dev-deploy.
As a workaround, you can try running the latest cli directly from your terminal:
near dev-deploy --wasmFile="./contract.wasm" -f
Just check that you installed the latest version of near-cli, currently 2.2.0. You can check your version with near --version.
Be sure to run yarn build first, so you'll have the compiled contract.wasm file.
Note: When you run yarn deploy, it uses the old near-cli version defined in package.json. (probably some old version like 1.6.0)
You might also want to check this GitHub issue (dev-deploy error): https://github.com/near/create-near-app/issues/1408

Deploying KotlinJs React web app to Heroku, error extracting tar content of undefined failed

I have the following setup. Kotlin Multiplatform project with a Web App and Shared module. I also have included a build of a library that I had to modify myself as it wasn't working properly.
When trying to deploy to Heroku with these steps I get the following error
> Task :common:root:jsPackageJson
> Task :web-app:packageJson
> Task :web-app:testPackageJson
> Task :rootPackageJson
> Task :kotlinNpmInstall
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/LICENSE'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/data/features/getcomputedstyle.js'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall FAILED
> Task :kotlinNpmInstall FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':firebase-kotlin-sdk:kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 5m 20s
18 actionable tasks: 18 executed
! ERROR: Failed to run Gradle!
We're sorry this build is failing. If you can't find the issue in application
code, please submit a ticket so we can help: https://help.heroku.com
You can also try reverting to the previous version of the buildpack by running:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
Thanks,
Heroku
! Push rejected, failed to compile Gradle app.
! Push failed
Tried running kotlinNpmInstall locally on both the library and the whole project and it works properly, with no failures.
While I do not know the exact cause, it seems that multiple yarn process are spawned that corrupt each other's packages.
This can be solved with the mutex option.
To add yarn options to a kotlin/js project you can add a .yarnrc file to the root of your project.
My .yarnrc's content:
--install.mutex network
This makes yarn use a predefined port on the network for its mutex.

How to resolve this error : spawn yarn ENOENT?

Yarn Install successful:
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>yarn
yarn install v1.22.10
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 2.77s.
Yarn dist error:
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>yarn dist
yarn run v1.22.10
$ yarn build prod
$ node development/build/index.js prod
running task "prod"...
Starting 'prod'...
Starting 'clean'...
(node:12548) ExperimentalWarning: The fs.promises API is experimental
Finished 'clean'
Starting 'styles:prod'...
Finished 'styles:prod'
Starting 'scripts:deps:background'...
Starting 'scripts:deps:ui'...
Starting 'scripts:core:prod:background'...
Starting 'scripts:core:prod:ui'...
Starting 'scripts:core:prod:phishing-detect'...
Starting 'scripts:core:prod:contentscript'...
Starting 'static:prod'...
Starting 'manifest:prod'...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn yarn ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>

WIndows Gitlab-runner: Failed to requeue the runner

I have a pipeline with 2 jobs.
I start user as super user on windows with debug mode and received next output:
Checking for jobs... received job=24173 repo_url=https://scm-01.oursite.com/theproject/theproject-tests.git runner=ub7wf5mg
Failed to requeue the runner builds=1 runner=ub7wf5mg
Running with gitlab-runner 12.8.0 (1b659122) job=24173 project=789 runner=ub7wf5mg
on vm14rkwEggplant ub7wf5mg job=24173 project=789 runner=ub7wf5mg
Shell configuration: environment: []
dockercommand:
- PowerShell
- -NoProfile
- -NoLogo
- -InputFormat
- text
- -OutputFormat
- text
- -NonInteractive
- -ExecutionPolicy
- Bypass
- -Command
- '-'
command: powershell
arguments:
- -noprofile
- -noninteractive
- -executionpolicy
- Bypass
- -command
passfile: true
extension: ps1
job=24173 project=789 runner=ub7wf5mg
Using Shell executor... job=24173 project=789 runner=ub7wf5mg
Waiting for signals... job=24173 project=789 runner=ub7wf5mg
No referees configured job=24173 project=789 runner=ub7wf5mg
Executing build stage build_stage=prepare_script job=24173 project=789 runner=ub7wf5mg
Executing build stage build_stage=get_sources job=24173 project=789 runner=ub7wf5mg
Feeding runners to channel builds=1
WARNING: Failed to parse "X-GitLab-Trace-Update-Interval" header error=strconv.Atoi: parsing "": invalid syntax header-value= job=24173 runner=ub7wf5mg
Appending trace to coordinator... ok code=202 job=24173 job-log=0-536 job-status=running runner=ub7wf5mg sent-log=0-535 status=202 Accepted update-interval=0s
Executing build stage build_stage=upload_artifacts_on_failure job=24173 project=789 runner=ub7wf5mg
Skipping referees execution job=24173 project=789 runner=ub7wf5mg
WARNING: Job failed: exit status 1 duration=4.9592837s job=24173 project=789 runner=ub7wf5mg
WARNING: Failed to parse "X-GitLab-Trace-Update-Interval" header error=strconv.Atoi: parsing "": invalid syntax header-value= job=24173 runner=ub7wf5mg
Appending trace to coordinator... ok code=202 job=24173 job-log=0-2526 job-status=running runner=ub7wf5mg sent-log=536-2525 status=202 Accepted update-interval=0s
Submitting job to coordinator... ok code=200 job=24173 job-status= runner=ub7wf5mg
WARNING: Failed to process runner builds=0 error=exit status 1 executor=shell runner=ub7wf5mg
Output of pipeline in gitlab is next:
Running with gitlab-runner 12.8.0 (1b659122)
on vm14rkwEggplant ub7wf5mg
Using Shell executor...
Running on KS-IDE-TS4...
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in C:/GitLab-Runner/builds/ub7wf5mg/0/ourproject/ourproject-winappdriver-tests/.git/
From https://scm-01.ourproject.com/ourproject/ourproject-winappdriver-tests
* [new ref] refs/pipelines/5813 -> refs/pipelines/5813
Checking out c924c09b as master...
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/Microsoft.CodeAnalysis.CSharp.dll: Invalid argument
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/Microsoft.CodeAnalysis.dll: Invalid argument
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/Microsoft.CodeAnalysis.VisualBasic.dll: Invalid argument
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/Microsoft.DiaSymReader.Native.amd64.dll: Invalid argument
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Buffers.dll: Invalid argument
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Collections.Immutable.dll: Permission denied
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Memory.dll: Permission denied
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Numerics.Vectors.dll: Permission denied
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Reflection.Metadata.dll: Permission denied
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Runtime.CompilerServices.Unsafe.dll: Permission denied
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/System.Threading.Tasks.Extensions.dll: Permission denied
warning: failed to remove packages/Microsoft.Net.Compilers.Toolset.3.4.0/tasks/net472/VBCSCompiler.exe: Invalid argument
ERROR: Job failed: exit status 1
If I restart the runner the first job became succesefull, but the secound one fails again with very similiar error.
The git version is
git version 2.25.1.windows.1
Is there any workaround for this issue? If downgrade of runner could help me?
So the problem was that I had a running process with a location in my repository. First, I kill it manually and the job started to work properly. Then I deleted this package at all from my solution and started to use the same file but from outside of the repository.
It was VBCSCompiler.exe file.
To try, you can first kill it manually from runner or by the cmd command:
tasklist | find /i "VBCSCompiler.exe" && taskkill /im VBCSCompiler.exe /F \|| echo process "VBCSCompiler.exe" not running.
Then I delete the nuget package Microsoft.Net.Compilers.Toolset, therefore this process path was changed to the
C:\Program Files (x86)\Microsoft Visual
Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn

Resources