Zeit asking me for "mysql2" dependency, but I have it installed - javascript

I'm trying to make a project work on zeit hosting. I'm using Node with Express and Sequelize with mysql2.
When I try to run the app in zeit, it give me the following errors:
-------------------------------------------------------
Duration: 425.50 ms Billed Duration: 500 ms Memory Size: 3008 MB Max Memory Used: 96 MB
RequestId: 2923134e-be9b-4223-96c7-dce58b5a0b19 Process exited before completing request
Error: Please install mysql2 package manually
-------------------------------------------------------
I have mysql2 installed on my project, and the app runs perfectly fine in localhost. What could be causing this?
I have tried to add node_modules on the github repo, and also tried to unninstall mysql2 and reinstall it as global, but both didn't work.
I just don't know if this problem is caused by some code error or some mistake related to the way I uploaded the files.
Here's the Github repo, you can check the project running on localhost normally.
https://github.com/vitorlimadev/employee_management_system

This is a known bug with ncc that has a workaround.
let db = new Sequelize({
dialect: 'mysql',
dialectModule: require('mysql2')
});
See this comment: https://github.com/vercel/ncc/issues/345#issuecomment-487404520

Related

You're not authorized to run analysis. Please contact the project administrator Sonarqube local

I have very basic setup of sonarqube. It is in initial phase only and it's kind of strange that I'm not able to access sonarqube report at localhost:9090 (default is of course 9000 but I just changed it to 9090). I'm able to login to sonarqube at localhost:9090
When I run node sonarqube-scanner.js command, it gets executed successfully as shown below but it gives authorization error,
INFO: Analysis report generated in 225ms, dir size=144.8 kB INFO:
Analysis report compressed in 338ms, zip size=49.6 kB INFO:
INFO: EXECUTION FAILURE INFO:
INFO: Total time: 6:16.209s INFO: Final Memory: 16M/60M INFO:
ERROR: Error during SonarScanner execution ERROR: You're not
authorized to run analysis. Please contact the project administrator.
My sonarqube-scanner.js file is as below, as you can I tried with everything eg login, password, token
const scanner = require('sonarqube-scanner');
scanner(
{
serverUrl: "http://localhost:9090",
login: "XXX",
password: "XXX",
token: "sqa_bXXXXXXXXXXXXXXXXX",
options: {
"sonar.sources": "./src"
},
},
() => process.exit()
);
And I use sonarqube docker image as below
docker-compose.yml
version: "3"
services:
sonarqube:
image: sonarqube:community
depends_on:
- db
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
ports:
- "9090:9000"
db:
image: postgres:12
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
postgresql:
postgresql_data:
NOTE : At localhost:9090->Administration->Security-> all checkboxes are checked for all users. Still it is not working.
I literally don't know if anything has changed but I observed one thing as below,
Earlier few days ago,
I was able to generate the report directly to localhost:9090 but all of sudden from today it started indicating You're not authorized to run analysis. Please contact the project administrator.
The Problem
Earlier it used to generate the report on-the-fly directly and create the project on its own. What I mean by that is even when your server is not configured with any project (consider it is completely blank) and if you are running the sonar analysis for the first time, it used to create the project on-the-fly on the sonarqube-server (localhost).
This not not the case anymore (at least in my case)
in my case, my sonarqube-server was completely empty (without any project) and when I was trying to run the sonar analysis again for the first time, it started throwing the error that you are not authorized.
Solution
I just had to create the project manually in sonarqube-server. Then when I ran the analysis, it ran successfully without any problem.
I hope this answer will help someone in future.
It was working for me with 9.4, but not anymore with 9.5.
Did you upgrade recently to 9.5 version?
Perhaps linked to: https://jira-legacy-sonarsource.valiantys.net/browse/SONAR-16260.

Why am I getting an error when trying to run a new react native project

I have created a new react native project by running "react-native init MyFirstProject". I have also installed node and have added no code of my own to any of the files.
I have tried to run the project to make sure it works by running "react-native run-ios --simulator="iPhone 8"". The command runs successfully but I am given the following error.
Could not connect to development server.
Ensure the following:
Node server is running and available on the same network - run 'npm start' from react-native root
Node server URL is correctly set in AppDelegate
WiFi is enabled and connected to the same network as the Node Server
URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
Blockquote
GSEventRunModal
UIApplicationMain
main
start
How do I fix this error?
Try opening your project ios/MyFirstProject/MyFirstProject.xcworkspace and see if there's any build error.
I ran into this problem too, with the same error:
RCTFatal __28-[RCTCxxBridge handleError:]_block_invoke
It turned out that I had another server running on my local machine on the same port that the expo development client server was running (:8081), and that it was taking priority and then obviously giving the client a very different response to what it was expecting. Quitting the other server fixed the problem.

MongoDB no longer starts after updating

I recently updated my MongoDB server from 3.2 to 3.6 to fix some errors with naming. When I had my Mongo server as 3.2 it did work fine.
I downloaded the MongoDB 3.6 from https://www.mongodb.com/download-center/community and installed it with the package manager (sudo dpkg -i mongodb-org-server_3.6.12_amd64.deb) and I have verified that the server did update with mongod --version.
As far as I know, starting the system works, but when I run mongo, or sudo mongo, it gives me the following output
MongoDB shell version: 3.2.22
connecting to: test
2019-05-14T13:28:09.049-0400 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2019-05-14T13:28:09.049-0400 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:229:14
#(connect):1:6
exception: connect failed
I'm not sure how I could fix the problem either, I have tried to restart the service and restarting the server it's running on (Ubuntu 16.04) and neither worked. Nothing I found online could help either so if you know a possible solution, please let me know, thanks!
Before that, try with
sudo service mongod stop
sudo rm /var/lib/mongodb/mongod.lock
mongod –repair
sudo service mongod start

Syntaxerror: Unexpected Token , in Hawk (fresh npn install)

I am in the process of learning Nodejs and WebRPC. I am for all intents and purposes, a novice.
I installed the Plivo (http://plivo.com) API for nodejs and when attempting to run it I had an issue with Const which I resolved by running my test file with --harmony appended to the start of the command, after this I have gained the error
Syntaxerror: Unexpected token ,
This error falls on line 506 of
\hawk\lib\server.js
The relevant section of code is;
const artifacts = {
ts: authorization.ts,
nonce: authorization.nonce,
host,
port,
hash: authorization.hash
};
line 506 is host,
I do not see the problem.
At this point, all I am trying to do is initialise the plivo API. I have no other calls to it.
I have deleted the hawk folder and done a fresh npm install hawk, can anyone else suggest anything?
edit:
As of writing the post, I attempted to load hawk directly in a script rather than as a dependency through plivo. It still brings up the same error so it won't be a problem with plivo.
Edit 2.
Seems it was a versioning issue. My system had v0.12 installed. I attempted to update it twice, both times the install went back to v0.12 despite uninstalling it first.
Cleared appdata\roaming\npm and appdata\roaming\npm-cache as well as deleting any remaining node files in "c:\program files" before reinstalling. I now have 8.x installed and the syntax error is no longer showing.
Thanks
Ken

Trying to use meteor up on digital ocean

I have a digital ocean droplet that I am trying to deploy the most basic of meteor apps to, but I am getting a failing response. Any idea why this is happening?
UPDATE: added entire output
Anderss-iMac:microscope-deploy anderskitson$ mup deploy
Meteor-UP : Production Quality Meteor Deployments
--------------------------------------------------
Bundling Started: /Users/anderskitson/sites/microscope
Started TaskList: Deploying App
[bray.anderskitson.ca] uploading bundle
[bray.anderskitson.ca] uploading bundle: SUCCESS
[bray.anderskitson.ca] setting up env vars
[bray.anderskitson.ca] setting up env vars: SUCCESS
[bray.anderskitson.ca] invoking deployment process
[bray.anderskitson.ca] invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
Warning: Permanently added 'bray.anderskitson.ca,162.243.52.235' (RSA) to the list of known hosts.
npm WARN package.json http-proxy#1.0.0 No repository field.
npm http GET https://registry.npmjs.org/fibers
npm http 304 https://registry.npmjs.org/fibers
stop: Unknown instance:
bash: line 46: wait-for-mongo: command not found
-----------------------------------STDOUT-----------------------------------
> fibers#1.0.1 install /opt/meteor/tmp/bundle/programs/server/node_modules/fibers
> node ./build.js
`linux-x64-v8-3.14` exists; testing
Binary is fine; exiting
fibers#1.0.1 node_modules/fibers
meteor start/running, process 10373
wait for mongo(5 minutes) to initiaze
----------------------------------------------------------------------------
Completed TaskList: Deploying App
I ran into same problem and I figured out that this command wasn't fired really well
sudo npm install -g forever userdown wait-for-mongo
and I manually did that so I can see wait-for-mongo a valid command,
see if that helps you too.

Categories

Resources