M1 Apple Silicon MongoDB connection creates new database, also affects Docker deploy - node.js

I got a brand new MBP M1 Max last week, started porting over my development environment. Almost everything as far as nodejs and our projects ported, however, I did run into an issue with Docker. It turned out that I needed to tell Docker to compile in a linux environment and that resolved issues with BCRYPT.
What I was unaware of was that apparently, that deploy (to QA), did not have a good database connection. It turns out, that build connects to the server, but then creates a database named "test" and then is apparently using that database rather than the one specified in the URL.
To debug, I took the url from QA and plugged it into development and I am getting the same behavior.
On my old intel mac, I did full pulls and npm installs to get everything to match, and guess what, it works. So everything that was working on Thursday on Intel Mac works with the library updates and code updates since Thursday on the Intel Mac, but the M1 Mac... it doesn't fail, it just creates a whole new database! By the way, the docker deploys to QA also work on the intel mac. Something about the M1 Mac is causing this issue.
This does not even make sense to be a bug that one could experience due to a chip change.
Here is our QA DB URL minus information that would make our db public. It is hosted on MongDB Atlas. Anyone else seeing this behavior as well? Anyone got the work around?
login: mongodb+srv://fake:password#cluster0.something.mongodb.net/databasenameqa?replicaSet=atlas-12hyiw-shard-0&readPreference=primary&connectTimeoutMS=10000&authSource=admin&authMechanism=SCRAM-SHA-1
I am going to take this over to the git for mongo on node. Also, I just checked my localhost connection url and it looks like this:
mongodb://localhost:27017/databasenamedev
therefore its not the database name after the / that is the issue.

Related

Xamarin Android+iOS builds failing on Azure Dev Ops

I have an xamarin mobile app with 3 projects. Shared, Android and iOS.
All 3 build perfectly fine locally but fail on Azure Dev ops pipeline.
iOS and Android only have 2 xmal views that are platform specific. The rest are located in Shared.
For both of the xmal views, all the errors are coming from the code behind cs files complaining that something doesn't exist in the current context. There are around 80 errors like the one below. The errors are identical on both platform builds.
Example error from Droid build:
Droid\Views(Filename).xaml.cs(26,13): error CS0103: The name 'InitializeComponent' does not exist in the current context
This build hasn't run for a while, around 8 months. It used to work fine and none of the views xmal/cs code has changed. I'm assuming a version is now misconfigured somewhere.
Both builds run on VS 2022 pipelines.
Both builds restore okay.
I have tried (Mostly suggestions from similar posts)
Adding restore argurment to the Build step.
Checking name spaces match
Adding a small change (whitespace) to the 2 xmal pages to force a change.
Removing the shared project reference and re-adding it.
I would be grateful for any suggestions or ideas.
Thanks in advance.
In past experience, if something works locally and not on the build server pipeline; this usually points to a discrepancy between both machines, and potentially their versions of given libraries.
If you run the pipeline off of a local machine as well, maybe confirm that all libraries installed on that machine match your local ones (XCode, android-sdk, etc.)
If you run the pipeline off of a hosted machine, it maybe that the hosted images needs to be updated to a newer one to keep up with the project.

Problems running .NET Core 3.1 and SQL Server 2017 Linux images on Linux host

I'm running a Web API using .NET Core 3.1 with EF Core 3.1 connecting to a SQL Server 2017 database. Every component is built in a Linux Docker image and I'm using docker-compose with Nginx as a reverse proxy to route to my Web API.
When I test my deployment on Windows 10 using Docker Desktop, everything works perfectly. When I test the exact same images, with the exact same docker-compose.yml file on a Linux host (Ubuntu 18.04), the connection from the API to the Databse seems to drop from time to time, randomly, which is a problem when it happens in the middle of a DB write operation. I either get a 504 (timeout), or worse, a lock on a database row which blocks access to that table.
Again, if I deploy in Windows, this never happens. Only happens when the Docker host is Linux.
Any help would be greatly appreciated. I've been trying to find some solution for the past 3 days, but nothing I've tried corrected that behaviour on my Linux box.
One more thing. On Windows, instead of connecting the API to the DB by name (the container's name), I'm using host.docker.internal in the connection string. There is no equivalent for Linux. I've read about a couple of hacks, but none seem to solve my problem.

Getting over a 426 upgrade required

I've been working on a web app (front Angular, back Node/Express/Mongo) for a few months now.
I run Angular on localhost:4200 and Node on localhost:3000
Some people in our team are running the backend in a VM that runs on their computers.
So that the app works in both cases we've edited the windows hosts file to make the app point to the correct place (either the VM or the back on the local machine)
127.0.0.1 mysite
Developers using the VM changed 127.0.0.1 with their VM's IP.
Everything worked smoothly.
A few days ago, our company installed bitlocker on every PC and I believe it caused our setup to break for everyone not using the VM (which is not subject to bitlocker)
People working on localhost started receiving from the front app:
OPTIONS http://mysite:3000/auth/login 426 (Upgrade
Required)
The requests are not even hitting the Node server. Looks like they're redirected to a websocket server?
If I change the requests to target localhost:3000 the app works again but we lose the setup for people working on the VM. (thus committing code becomes annoying if we need to change the base url each time)
I could make an environment for each case but it's not clean and I'd like to know why it suddenly broke.
Try changing the port from 3000 to something else.
I just ran into this issue when a coworker tried running an express app we've been building on a Windows machine for the first time, as opposed to an EC2 instance. I've been using a Mac during development.
The issue seemed to be that 0.0.0.0:3000 was already mapped on company Windows machines. If you run netstat -an in a command prompt you may see it in use already.
hello mate this usually happens due to protocol mismatch between the PC and server.TLS 1.0 and 1.1 were permanently deprecated on June 4 2018. I suspect you’re using something that still uses and old version of TLS.

SQL Server 2014 Express refusing to install

This is a desperate cry for help. I am working on my finals exam and need a few tools to do this, mainly an SQL Server.
In short, I can't for whatever reason install SQL Server 2014 Express.
When installing, I just set up everything with its default values and settings and then let it perform the install, everything goes fine until it reaches the stage: SqlEngineDbStartConfigaction_install_configrc_cpu64 where it stop with an error. Details can be seen in this picture as well as error code and description: http://imgur.com/pq2BB6c
For the full error log just follow this link: http://pastebin.com/FfWeJi0i
I have tried literately everything I can think of, I edited permissions, registry, uninstalled reinstalled countless times, I updated windows several times, restarted countless times, I even went as far as to fully format my pc and start over.. however this too turned out to be a waste of time since the problem persists even after the reinstall of windows 7.
If I can't get this issue resolved I might not be able to finish my exam project, so consider me desperate.

MongoDB out of the box: not authorized for insert (Windows 7)

I've been following along with the actual MongoDB docs here
as well as several tutorial articles that are getting me absolutely nowhere.
Running a 64bit windows OS (which is a work computer, and my particular windows login is not an administrator login.. so I make sure to open any exe files as administrator). I can't do anything in the terminal beyond "mongo" or "use [db name]".
I cannot save or add anything like db.testData.insert( j ). Even typing "show dbs", I get an error that says
listDatabases failed:{ "ok" :0, "errmsg" : "unauthorized" } at src/mongo/shell/mongo.js:46
With every example I've followed, I can never seem to be "authenticated" to get past point A. Please help me! I have no idea what I'm doing wrong at this point.
UPDATE:
Sorry for the confusion, everyone. The problem turned out to be that I had an old MongoDB service still running in the background that I needed to disable.
The service must have been turned on while I was testing out some node packages or something. Once I disabled the service, everything started working as expected.
So for those of you who are having trouble, make sure you open up services.msc and make sure nothing is running MongoDB
As there isn't a formal installer for Windows, I'd recommend you delete the data folder and restart. Out of the box, there is no security in MongoDb, so you've followed a step which later requires a password. Either retrace your steps, or start over.
You don't need to switch to the admin Database. I'd suggest you instead switch to a test database for example:
> use test
switched to db test
By default, without extra configuration, on Windows you can delete the contents of c:\data\db when MongoDb isn't running (but if you're using a configuration file that specifies the dbpath, delete the contents of that folder).
There are a number of tutorials with details of how to configure users/security with Mongodb that you may want to read after you've resolved this issue.
There's little reason to create users and administrative control with MongoDB until you gain some experience with the platform. In fact, I wouldn't recommend it at all. It just gets in the way as you're seeing for no real gain.

Resources