<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roland Joshua</title>
    <description>The latest articles on DEV Community by Roland Joshua (@289volts).</description>
    <link>https://dev.to/289volts</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F936966%2F27805dab-4a92-4c46-a548-aa6e3418eda1.jpeg</url>
      <title>DEV Community: Roland Joshua</title>
      <link>https://dev.to/289volts</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/289volts"/>
    <language>en</language>
    <item>
      <title>"mongodb-community error 3584" solved: A curious deep dive</title>
      <dc:creator>Roland Joshua</dc:creator>
      <pubDate>Sun, 19 Jan 2025 18:26:23 +0000</pubDate>
      <link>https://dev.to/289volts/mongodb-community-error-3584-solution-a-curious-deep-dive-4h5a</link>
      <guid>https://dev.to/289volts/mongodb-community-error-3584-solution-a-curious-deep-dive-4h5a</guid>
      <description>&lt;p&gt;It's a year of curious learning for me and this involves encountering bugs and even recreating them just so I learn from them.&lt;/p&gt;

&lt;p&gt;I started a deep dive into mongoDB this month so that I fully understand how to use the tool. I ran into this issue and I spent over three hours trying to fix it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The cause of the error was starting my mongo service with the &lt;code&gt;sudo&lt;/code&gt; command which I advise against because it exposes your system to unnecessary risks if mongoDB is compromised. For your case, it could be something else.&lt;/p&gt;

&lt;p&gt;I didn't find any useful resource on forums or blogs. But with help from ChatGPT and the official docs, I was able to come to a solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Objectives
&lt;/h2&gt;

&lt;p&gt;At the end of this article, you'll have learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how to solve the &lt;strong&gt;mongodb-community error 3584&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;how to read mongodb logs from the terminal&lt;/li&gt;
&lt;li&gt;how to use terminal commands to change permissions&lt;/li&gt;
&lt;li&gt;how to troubleshoot errors&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://support.apple.com/en-us/116943" rel="noopener noreferrer"&gt;Apple Silicon chip Mac&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://brew.sh/#install" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt; package manager&lt;/li&gt;
&lt;li&gt;MongoDB &lt;a href="https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/#overview" rel="noopener noreferrer"&gt;Community edition&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;This article is intended to be a deep dive but if you're in a hurry, reference this.&lt;br&gt;
&lt;strong&gt;NOTE:&lt;/strong&gt; This solution will only work if you've used the sudo command to start the &lt;code&gt;mongod&lt;/code&gt; background service at any time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check logs to see errors.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /opt/homebrew/var/log/mongodb/mongo.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you see any "Permission denied" error message, proceed with this solution. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restore the permissions to the non-root user:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R $(whoami):admin /opt/homebrew/Cellar/mongodb-community
sudo chown -R $(whoami):admin /opt/homebrew/opt/mongodb-community
sudo chown -R $(whoami):admin /opt/homebrew/var/homebrew/linked/mongodb-community
sudo chown -R $(whoami):admin /opt/homebrew/var/mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Verify that the non-root user now has permissions for the previously affected files
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -ld /opt/homebrew/var/mongodb
ls -l /opt/homebrew/var/mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Restart the mongod background services
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew services restart mongodb-community
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Start up the mongo shell
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongosh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  The deep dive into solving the error.
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo brew services start mongodb-community@8.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I attempted to run the mongod background service using the sudo command because I saw the instructor do same in the video resource I am using (rookie mistake🥲). This was what led me down the rabbit hole of solving this error. &lt;/p&gt;

&lt;p&gt;The command was successful but I got a soft warning that the permissions and ownership of some folders and files have changed. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F065dfs2adl096o8tz1io.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F065dfs2adl096o8tz1io.png" alt="Soft warning showing all the files that the root user now own" width="800" height="249"&gt;&lt;/a&gt;&lt;br&gt;
I should have known something was going to go wrong from that point but hey, curious learning, right?.&lt;/p&gt;

&lt;p&gt;I switched my terminal tab and attempted to run the &lt;code&gt;mongosh&lt;/code&gt; command to start up the mongo shell but I got a network connection error. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feyido92g7jnr4obga252.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feyido92g7jnr4obga252.png" alt="MongoNetworkError" width="800" height="109"&gt;&lt;/a&gt;&lt;br&gt;
I didn't change the port, so why the error? Time to troubleshoot🛠️.&lt;/p&gt;
&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;Using a &lt;code&gt;brew&lt;/code&gt; command, I first checked the services list to see if the service was running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew services list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0j3o0l2d1x8zlusoxw10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0j3o0l2d1x8zlusoxw10.png" alt="services list" width="752" height="112"&gt;&lt;/a&gt;&lt;br&gt;
The service was running but with an error. No error message provided. So what do I work with?&lt;/p&gt;

&lt;p&gt;In a previous video, the instructor talked about the &lt;strong&gt;mongodb logs&lt;/strong&gt; that is created on my local machine. It logs out entries of different actions so it should definitely tell what happened.&lt;/p&gt;

&lt;p&gt;In the docs, the path to the logs was specified as &lt;code&gt;/opt/homebrew/var/log/mongodb&lt;/code&gt; so I read the log file using the &lt;code&gt;cat&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /opt/homebrew/var/log/mongodb/mongo.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&amp;gt; Running this command will print out the existing logs to the terminal but the downside is that it's not prettified. &lt;br&gt;
However, with a little patience and eyes squinting, I was able to find the log for the start of the service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfp9v9p1o1nxmzj2craj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfp9v9p1o1nxmzj2craj.png" alt="Entry log for the start of the service" width="800" height="17"&gt;&lt;/a&gt;&lt;br&gt;
-&amp;gt; The object can only contain these keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "t": &amp;lt;Datetime&amp;gt;, // timestamp of the log message in ISO-8601 format
  "s": &amp;lt;String&amp;gt;, // Short severity code of the log message
  "c": &amp;lt;String&amp;gt;, // Full component string for the log message
  "id": &amp;lt;Integer&amp;gt;, // Unique identifier for the log statement.
  "ctx": &amp;lt;String&amp;gt;, // Name of the thread that caused the log statement.
  "svc": &amp;lt;String&amp;gt;, //   
Name of the service in whose context the log statement was made.
  "msg": &amp;lt;String&amp;gt;, // message body of the log
  "attr": &amp;lt;Object&amp;gt;, // additional attributes (optional)
  "tags": &amp;lt;Array of strings&amp;gt;, // tags (optional)
  "truncated": &amp;lt;Object&amp;gt;, // truncation info (if truncated)
  "size": &amp;lt;Object&amp;gt; // original size of entry (if truncated)
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To read more about logs, check out the &lt;a href="https://www.mongodb.com/docs/manual/reference/log-messages" rel="noopener noreferrer"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I copied the most recent logs and used chatGPT to prettify it to JSON.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "t": { "$date": "2025-01-19T13:10:07.261+01:00" },
  "s": "E",
  "c": "WT",
  "id": 22435,
  "ctx": "initandlisten",
  "msg": "WiredTiger error message",
  "attr": {
    "error": 13,
    "message": "[1737288607:261307][2013:0x1f722f840], wiredtiger_open: [WT_VERB_DEFAULT][ERROR]: int __posix_open_file(WT_FILE_SYSTEM *, WT_SESSION *, const char *, WT_FS_OPEN_FILE_TYPE, uint32_t, WT_FILE_HANDLE **), 928: /opt/homebrew/var/mongodb/WiredTiger.turtle: handle-open: open: Permission denied"
  }
}
{
  "t": { "$date": "2025-01-19T13:10:07.261+01:00" },
  "s": "W",
  "c": "STORAGE",
  "id": 22347,
  "ctx": "initandlisten",
  "msg": "Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade."
}
{
  "t": { "$date": "2025-01-19T13:10:07.261+01:00" },
  "s": "F",
  "c": "STORAGE",
  "id": 28595,
  "ctx": "initandlisten",
  "msg": "Terminating.",
  "attr": { "reason": "13: Permission denied" }
}
{
  "t": { "$date": "2025-01-19T13:10:07.261+01:00" },
  "s": "F",
  "c": "ASSERT",
  "id": 23091,
  "ctx": "initandlisten",
  "msg": "Fatal assertion",
  "attr": {
    "msgid": 28595,
    "file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
    "line": 761
  }
}
{
  "t": { "$date": "2025-01-19T13:10:07.261+01:00" },
  "s": "F",
  "c": "ASSERT",
  "id": 23092,
  "ctx": "initandlisten",
  "msg": "\n\n***aborting after fassert() failure\n\n"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The focus of this result would be the "Permission denied" errors. I was currently running the process in sudo mode which should give me access to the current files I was trying to access but it was still failing for some reason.&lt;/p&gt;

&lt;p&gt;So I troubleshooted further by checking the permissions on the files responsible for running the &lt;code&gt;mongod&lt;/code&gt; background service.&lt;/p&gt;

&lt;p&gt;I asked ChatGPT for a command that could help me do this. These were the suggested commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -ld /opt/homebrew/var/mongodb
ls -l /opt/homebrew/var/mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To understand what each line does, let me break it down for you.&lt;/p&gt;

&lt;p&gt;-&amp;gt; &lt;code&gt;ls -ld&lt;/code&gt; - Displays detailed information about the specified directory, but not its contents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;drwxr-xr-x  10 username  group  320 Jan 13 12:00 path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;d:&lt;/strong&gt; Indicates it is a directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rwxr-xr-x:&lt;/strong&gt; Permissions (owner has read/write/execute, group and others have read/execute).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;10:&lt;/strong&gt; Number of links (subdirectories or files).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;username:&lt;/strong&gt; Owner of the directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;group:&lt;/strong&gt; Group that owns the directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;320:&lt;/strong&gt; Size of the directory in bytes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jan 13 12:00:&lt;/strong&gt; Last modification date and time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-&amp;gt; &lt;code&gt;ls -l&lt;/code&gt; - Displays detailed information about the contents of the specified directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-------  1 username  group   1024 Jan 13 12:00 WiredTiger.turtle
-rw-------  1 username  group  40960 Jan 13 12:00 WiredTiger.wt
drwx------  3 username  group    128 Jan 13 12:00 journal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;-rw-------:&lt;/strong&gt; File permissions (read/write for owner, no access for group or others).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1:&lt;/strong&gt; Number of links (for files, this is usually 1).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;username:&lt;/strong&gt; Owner of the file or directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;group:&lt;/strong&gt; Group that owns the file or directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1024:&lt;/strong&gt; Size of the file in bytes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jan 13 12:00:&lt;/strong&gt; Last modification date and time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WiredTiger.turtle:&lt;/strong&gt; Name of the file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Looking at the output, I noticed something different. The files and folders were registered to my &lt;code&gt;root&lt;/code&gt; user but the service is recommended to be used with the non-root user (the current user profile).&lt;/p&gt;

&lt;p&gt;So to restore back ownership and permissions to the non-root user, I had to use the &lt;code&gt;sudo&lt;/code&gt; command on the files that I was warned about.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R $(whoami):admin /opt/homebrew/Cellar/mongodb-community
sudo chown -R $(whoami):admin /opt/homebrew/opt/mongodb-community
sudo chown -R $(whoami):admin /opt/homebrew/var/homebrew/linked/mongodb-community
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;chown&lt;/code&gt;:&lt;/strong&gt; change ownership&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;-R:&lt;/strong&gt; runs the command recursively on content of the specified folder&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;whoami&lt;/strong&gt;: this is a command that returns your username&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;admin:&lt;/strong&gt; this is a group that has been created on your laptop &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The files were restored and I ran the &lt;code&gt;mongosh&lt;/code&gt; command again. Should work now, right? Nope!&lt;/p&gt;

&lt;p&gt;Still had the permissions error again even after I had restored ownership to the files. So I went back to the logs.&lt;/p&gt;

&lt;p&gt;I still saw the "Permission denied" error and after careful analysis of the log object, I noticed the file which was causing the issue was &lt;code&gt;WiredTiger.turtle&lt;/code&gt; which meant that I haven't transferred ownership back to the file.&lt;/p&gt;

&lt;p&gt;Using the &lt;code&gt;ls&lt;/code&gt; command again, I found that the file still belonged to the root user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz71jul67fbdp3usc201t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz71jul67fbdp3usc201t.png" alt="root user WiredTiger file" width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;
The root user still maintaining ownership of the WiredTiger.turtle file



&lt;p&gt;I ran the &lt;code&gt;chown&lt;/code&gt; command on the directory of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R $(whoami):admin /opt/homebrew/var/mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I ran the &lt;code&gt;ls&lt;/code&gt; command again to check if the ownership has been changed, and alas, it was.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhn97nsbcz7tm0w1vzlqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhn97nsbcz7tm0w1vzlqf.png" alt="non root user WiredTiger file" width="800" height="109"&gt;&lt;/a&gt;&lt;/p&gt;
Non root user now holds ownership of the WiredTiger.turtle file



&lt;p&gt;Just to be sure, I had to restart the &lt;code&gt;mongod&lt;/code&gt; service and when the service started up I ran the &lt;code&gt;mongosh&lt;/code&gt; command with my fingers crossed and voila, it was successful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiu0szmi2brecxvg1k69k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiu0szmi2brecxvg1k69k.png" alt="mongosh command success" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Errors like these are exciting because they teach you to be resourceful and find solutions in the deepest places of the internet. &lt;/p&gt;

&lt;p&gt;After spending over three hours searching different forums on the internet trying to find a solution, the solutions I found were either for Intel macs or resorting to use MongoDB Compass (a GUI for accessing your database).&lt;/p&gt;

&lt;p&gt;The fastest way to grow is to break stuff so you can fix them and that's what I'll be doing most of the year. I hope I've been able to teach you all that I promised you'll learn from reading this article. &lt;/p&gt;

&lt;p&gt;Please drop a comment if you have other ways you've solved this.&lt;/p&gt;

&lt;p&gt;See you in my next adventure.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>programming</category>
      <category>database</category>
    </item>
    <item>
      <title>A Beginner's guide to writing better ALT texts</title>
      <dc:creator>Roland Joshua</dc:creator>
      <pubDate>Mon, 16 Oct 2023 10:07:49 +0000</pubDate>
      <link>https://dev.to/289volts/a-beginners-guide-to-writing-better-alt-texts-3462</link>
      <guid>https://dev.to/289volts/a-beginners-guide-to-writing-better-alt-texts-3462</guid>
      <description>&lt;p&gt;An image speaks more than a thousand words, but when used wrongly, you would convey the wrong information to people who can't see that image with their physical eyes.&lt;/p&gt;

&lt;p&gt;The web is used by a diverse group of users and web developers need to get every element of the web right. This means we need to make the web easy to navigate for people with any type of disability. Today I will be sharing few ways to properly use alt text for images so that users don't miss out on the important messages you might want to pass through images.&lt;/p&gt;

&lt;p&gt;Before we proceed, let's first understand what alt texts are. According to &lt;a href="https://webaim.org/" rel="noopener noreferrer"&gt;WebAIM(web accessibility in mind)&lt;/a&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Alternative text (ALt text) is a textual substitute for non-text content in web pages.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is about images but the same principles applies to other multimedia and non-text content. When &lt;a href="https://www.afb.org/blindness-and-low-vision/using-technology/assistive-technology-products/screen-readers" rel="noopener noreferrer"&gt;screen readers&lt;/a&gt; such as &lt;a href="https://support.microsoft.com/en-us/windows/complete-guide-to-narrator-e4397a0d-ef4f-b386-d8ae-c172f109bdb1" rel="noopener noreferrer"&gt;Microsoft Narrator&lt;/a&gt;, &lt;a href="https://www.freedomscientific.com/products/software/jaws/" rel="noopener noreferrer"&gt;JAWS&lt;/a&gt;, and &lt;a href="https://www.nvaccess.org/" rel="noopener noreferrer"&gt;NVDA&lt;/a&gt; reach digital content with alt text, they will read the alt text aloud, allowing people to better understand what is on the screen. &lt;br&gt;
Well written and descriptive alt text helps improve user experience and gives meaning to the content it is used for. It is beneficial that your image is understandable in the context of your overall page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative text can be used within&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;code&gt;alt&lt;/code&gt; attribute of the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element&lt;/li&gt;
&lt;li&gt;the visible body text near the image, eg. &lt;strong&gt;&lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;&lt;/strong&gt;. If the text can't be presented on that page, the alt text can be used on a separate page, linked from either the image or a text link adjacent to the image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The alt text should typically&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;be representing content and function &lt;strong&gt;accurately&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;be succinct.&lt;/strong&gt; Content (if any) and function (if any) should be presented as succinctly as possible, without sacrificing accuracy. Typically, it shouldn't be more than 125 characters long, though rarely a short sentence or two may be appropriate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;not be redundant&lt;/strong&gt; or provide the same information as text near the image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;not include phrases like "image of ..." or "graphic of ..."&lt;/strong&gt;, etc. This would be redundant since screen readers already announce "graphic" along with the alt text. If the fact that an image is a photograph or illustration, etc. is important content, it may be useful to include this in alternative text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Alt text can serve several functions&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some users who have visual or certain cognitive disabilities rely on screen readers to navigate the web and screen readers announce alternative text in place of images, helping users perceive the content and function of the images.&lt;/li&gt;
&lt;li&gt;If an image fails to load due to connectivity issues or the user has blocked images, the browser will present the alternative text visually in place of the image.&lt;/li&gt;
&lt;li&gt;Search engines use alternative text and factor it into their assessment of the page purpose and content.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some right contexts to use alt text
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example 1
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32bfl7zzu25xruiyogi5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32bfl7zzu25xruiyogi5.png" alt="Footballer Cristiano Ronaldo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When working with images , you need to first consider its &lt;strong&gt;content&lt;/strong&gt; and &lt;strong&gt;function&lt;/strong&gt;. In this example, the image is not used as a link or in a button, so it has no &lt;strong&gt;function&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The image content shows the user that this is Cristiano Ronaldo. He is also holding a named jersey indicating that he is a sportsperson - which is meaningful.&lt;/p&gt;

&lt;p&gt;"Image of Cristiano Ronaldo, Footballer" redundantly describes the image as an image.&lt;/p&gt;

&lt;p&gt;"Cristiano Ronaldo, latest Al-Nassr signing" is still referencing what is already in the body text.&lt;/p&gt;

&lt;p&gt;The image content is presented within the surrounding text, which means that our image is more understandable to visual users. You might be tempted to leave it as &lt;code&gt;alt=""&lt;/code&gt; but since the image conveys content, an alt text of &lt;code&gt;alt="Footballer Cristiano Ronaldo"&lt;/code&gt; would suffice. &lt;/p&gt;

&lt;h3&gt;
  
  
  Example 2
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrojtn2zrmtul4xcidbm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrojtn2zrmtul4xcidbm.jpg" alt="Don't wish for it, work for it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, the image has content in it but no surrounding text meaning there is no other context to the image. Sometimes, this type of image is used in articles or social media posts and the article or post will not have much context to the content of the image.&lt;/p&gt;

&lt;p&gt;Because the image has content, we cannot do &lt;code&gt;alt=""&lt;/code&gt; so we would have to use the content in the image as the alt text. The best option for this would be to do alt="Don't wish for it, work for it"&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 3
&lt;/h3&gt;

&lt;p&gt;When an image is wrapped within a link, it has &lt;strong&gt;function&lt;/strong&gt;. If it doesn't have any adjacent text inside the link to describe the link's function, the alt text for that image would be the content of the image or the link. The alt text cannot be empty because screen readers will then read out the filename of the image which would make no sense to your users.&lt;br&gt;
For example, &lt;code&gt;&amp;lt;a href="popsicle.com"&amp;gt;&amp;lt;img src="boy.png" alt="Little boy holding our popsicle" &amp;gt;&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 4
&lt;/h3&gt;

&lt;p&gt;When using an image for just decorative purposes, maybe as a logo in the header that links back to the homepage, you should resist the urge to do &lt;code&gt;alt="Logo"&lt;/code&gt; or `alt="[Company Name] Logo". Adding the word 'logo' is redundant there because it's not important to the image's content or the function, so just the company/brand name will suffice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Designing the web with inclusivity in mind will at the long run benefit everyone and parts of the web like images play a huge role to passing your message to your users. Little things like this can be easily overlooked but it's beneficial to get it right. I hope you'll begin to write better and more meaningful alt texts from now onwards.&lt;/p&gt;

&lt;p&gt;To further learn more ways to write better and relevant alt texts, check out WebAIM's article on &lt;a href="https://webaim.org/techniques/alttext/" rel="noopener noreferrer"&gt;Alternative Texts&lt;/a&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
