Random 403 error during resolving packages on Artifactory - apache

We use Artifactory Pro.
We have a virtual repo in which we've stored the installer of yarn 23.04.
On another instance we have running a Jenkins 1 server. We have some maven project and our maven goal is to perform:
clean source:jar install -DskipTests -Pyarn -X
We use the profile yarn so a yarn install will be executed.
We are not using any proxy about our configuration. We have turned them off explicitly
Most of the time the jenkins job works:
[INFO] yarn install v0.23.4
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[ERROR] warning fsevents#1.1.1: The platform "linux" is incompatible with this module.
[INFO] info "fsevents#1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[ERROR] warning "ng2-translate#5.0.0" has incorrect peer dependency "#angular/core#^2.0.0".
[ERROR] warning "ng2-translate#5.0.0" has incorrect peer dependency "#angular/http#^2.0.0".
[ERROR] warning "sass-loader#6.0.5" has incorrect peer dependency "webpack#^2.0.0".
[INFO] [4/4] Building fresh packages...
[INFO] success Saved lockfile.
But on certain occasions it fails:
[INFO] yarn install v0.23.4
[INFO] [1/4] Resolving packages...
[ERROR] an unexpected error occurred: "http://xxx/artifactory/api/npm/npm/xxx: Request\ "http://xxx/artifactory/api/npm/npm/xxx" returned a 403
The yarn is in our artifactory. So we think the only issue can be a 'bad connection' between jenkins and Artifactory or the apache which is running above Artifactory.
Is there some specific setting in Apache that could cause this behaviour of Artifactory?

Related

ValidationError: "trackingID" is required

I'm trying to upgrade docusaurus to the latest version v2.3.1 but got the following errors when running yarn start
yarn start
yarn run v1.22.19
$ docusaurus start
[INFO] Starting the development server...
[ERROR] ValidationError: "trackingID" is required
[INFO] Docusaurus version: 2.3.1
Node version: v18.12.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Here is the config:
https://github.com/OpenAPITools/openapi-generator/blob/relesae-fix/website/docusaurus.config.js
Searched for the error message but got nothing related to trackingID in particular.

yarn CRA failed

MBP:~ Tim$ yarn create react-app my-app --template typescript
yarn create v1.22.19
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "http://nexus.qcpaws.qantas.com.au/nexus/repository/npm-repo/fstream/-/fstream-1.0.11.tgz: getaddrinfo ENOTFOUND nexus.qcpaws.qantas.com.au".
info If you think this is a bug, please open a bug report with the information provided in "/Users/benli/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
So when I use yarn to create React App, it will try to install a package from qantas.com.au
I worked at Qantas before, so I must have set the registry somewhere.
So far, I've tried:
run yarn cache clearn to clean the cache, not working
uninstall yarn globally and re-install again, not working
check yarn config list to list the config, but cannot find qantas.com related information
checked .npmrc and .yarnrc, but cannot find any clues
Can someone help me how to remove the nexus registry?
thanks

Expo React Native Invariant Violation: "main" has not been registered

I started getting this error today
Invariant Violation: "main" has not been registered. This can happen
if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
I read in this thread Invariant Violation: "main" has not been registered While running react-native app that might be because i have multiple versions of react native safe area content.
I ran npm why react-native-safe-area-content and this is what i got
react-native-safe-area-context#4.2.4
node_modules/react-native-safe-area-context
react-native-safe-area-context#"4.2.4" from the root project peer
react-native-safe-area-context#">= 3.0.0" from
#react-navigation/elements#1.3.3
node_modules/#react-navigation/elements
#react-navigation/elements#"^1.3.3" from #react-navigation/native-stack#6.6.2
node_modules/#react-navigation/native-stack
#react-navigation/native-stack#"^6.6.2" from the root project
#react-navigation/elements#"^1.3.3" from #react-navigation/stack#6.2.1
node_modules/#react-navigation/stack
#react-navigation/stack#"^6.2.1" from the root project peer react-native-safe-area-context#">= 3.0.0" from
#react-navigation/native-stack#6.6.2
node_modules/#react-navigation/native-stack
#react-navigation/native-stack#"^6.6.2" from the root project peer react-native-safe-area-context#">= 3.0.0" from
#react-navigation/stack#6.2.1 node_modules/#react-navigation/stack
#react-navigation/stack#"^6.2.1" from the root project
But i don't know what to do now, how should i proceed?
In my case, the version of the react-native-safe-area-context in my package.json was different from the one used in a dependency. The solution was to use the same version the dependency was using.
My package.json had 4.3.1 while my dependency (react-native-gifted-chat) had 4.4.1, a higher version.
To figure out the versions I used yarn why react-native-safe-area-context.
$ yarn why react-native-safe-area-context
yarn why v1.22.19
[1/4] 🤔 Why do we have the module "react-native-safe-area-context"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "react-native-safe-area-context#4.3.1"
info Reasons this module exists
- "_project_#expo-app" depends on it
- Hoisted from "_project_#expo-app#react-native-safe-area-context"
info Disk size without dependencies: "1016KB"
info Disk size with unique dependencies: "1016KB"
info Disk size with transitive dependencies: "1016KB"
info Number of shared dependencies: 0
=> Found "react-native-gifted-chat#react-native-safe-area-context#4.4.1"
info This module exists because "_project_#expo-app#react-native-gifted-chat" depends on it.
info Disk size without dependencies: "968KB"
info Disk size with unique dependencies: "968KB"
info Disk size with transitive dependencies: "968KB"
info Number of shared dependencies: 0
✨ Done in 0.94s.
To match the versions I installed the specific version using the command below
yarn add react-native-safe-area-context#4.4.1

How to resolve yarn warnings

I created a new project with the vue cli.
This project is a Vue3 with Ant Design, Vue Router and Eslint.
However when I give the yarn command it shows me the following warnings.
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#2.3.2: The platform "win32" is incompatible with this module.
info "fsevents#2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "win32" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "#vue/eslint-config-airbnb > eslint-import-resolver-webpack#0.13.0" has unmet peer dependency "webpack#>=1.11.0".
warning " > less-loader#7.3.0" has unmet peer dependency "webpack#^4.0.0 || ^5.0.0".
[4/4] Building fresh packages...
Done in 26.91s.
The webpack I noticed is already installed directly on vue 3. How do I resolve these warnings?
for fsevents it seems that it's a MacOS-only library so that might explain why you got the first error.
for peer dependencies and webpack if you are using Yarn it seems that you have to do yarn add webpack --peer or as #kaumadie said in a comment you can also add it directly on the package.json file of your project
With npm, you can do npm i directly in the project's folder and it should resolve all peer dependencies automatically
Hope it helped you, and have a good day !

react-native init gives ESOCKETTIMEDOUT error

I am using a Macbook and when I try to create a React Native app, it throws ESOCKETTIMEDOUT error.
I have tried to clean the npm and yarn cache however it doesn't help.
react-native init AwesomeProject
This will walk you through creating a new React Native project in /Users/gaurang.shah/Documents/personal/code/mobile/AwesomeProject
Using yarn v1.13.0
Installing react-native...
yarn add v1.13.0
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/Users/gaurang.shah/Documents/personal/code/mobile/AwesomeProject/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
I am able to download the https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz file through my browser, so it can't be networking issue.
Stacktrace
Yarn version:
1.13.0
Node version:
11.10.0
Platform:
darwin x64
Trace:
Error: https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (/usr/local/Cellar/yarn/1.13.0/libexec/lib/cli.js:130024:19)
at Object.onceWrapper (events.js:285:13)
at ClientRequest.emit (events.js:197:13)
at TLSSocket.emitRequestTimeout (_http_client.js:669:40)
at Object.onceWrapper (events.js:285:13)
at TLSSocket.emit (events.js:197:13)
at TLSSocket.Socket._onTimeout (net.js:447:8)
at listOnTimeout (timers.js:327:15)
at processTimers (timers.js:271:5)
npm manifest:
{"name":"AwesomeProject","version":"0.0.1","private":true,"scripts":{"start":"node node_modules/react-native/local-cli/cli.js start"}}
yarn manifest:
No manifest
Lockfile:
No lockfile
Had the same issue when retrieving big packages on a slow network. As suggested on this comment, increasing the network timeout for installing the packages worked for me.
Firstly, have your project directory created beforehand and then create a .yarnrc file inside of it having the following content:
network-timeout 600000
Now, just run the react-native init <project_name> command from the parent directory of your project as you did.
It is equivalent to running yarn like so:
yarn install --network-timeout 600000
If npm can be used, please use 'npm install' & it generates package-lock.json or 'yarn install --network-timeout <time in ms>' - generates yarn.lock. Both works for me.