Getting "cannot GET /admin" when trying to access netlify cms

Hi there,

I have deployed my 11ty website on netlify. I enabled identity and Git Gateway from the netlify site dashboard. Followed all steps here: Add to Your Site | Netlify CMS | Open-Source Content Management System but still can’t access netlify CMS. The error which I get while accessing admin cms reads “cannot GET /admin”.

My Git repository is GitHub - rakshitsoral/Dante: My site: http://www.tedgoas.com

Please help me find the root cause of the error. Any suggestion would be highly appreciated.

Hey @rakshitsoral

Check out surjithctly/neat-starter which is the Eleventy Starter listed on the Netlify CMS website. Note specifically the location of admin is in src, not the repository root.

1 Like

Hi! still, I am finding trouble to access the netlify content manager. When I run NPM start and put a “/admin” after base URL, it shows the following error:

Error loading the CMS configuration

Config Errors:

Error: Failed to load config.yml (404)

Check your config.yml file.

I read some comments here (Error message: Error: Failed to load config.yml (404) · Issue #1456 · netlify/netlify-cms · GitHub) that says to run “npm run build” and “npm run serve”. But “npm run build” doesn’t works for me and “npm run serve” is giving the same error again. Also the other comment from the same link says to put localhost:8001/admin/# to rectify it, but I am not finding any success with it. God knows why!

What according to you could be the problem? Looking forward to any help!

Hey @rakshitsoral

I do not see a config.yml file anywhere in the repository listed above (is this the repository you are still using?) The absence of the file would explain the 404.

My repository is GitHub - rakshitsoral/Dante: My site: http://www.tedgoas.com

And the repository file is in “/src/admin/”.

You added admin/config.yml and admin/index.html with this commit but not under src, at the repository root.

In the following commit both these files were deleted and they remain so.

admin neither exists in src in the repository root now.

Hey

I now did another commit and added admin/config.yml and admin/index.html under src folder. You can see this commt.

Still the issue persists and I am getting the same error:

# Error loading the CMS configuration

**Config Errors:**

Error: Failed to load config.yml (404)

Check your config.yml file.

Is something wrong with my config file?

There is something wrong I believe but that is not the issue. The issue is the file does not exist in the build, hence the 404.

The error that I see is the first line is blank, and the second line starts with a tab/multiple spaces. This is, I believe, incorrect formatting. Have a look at the config.yml from the neat-starter I previously linked to.

The 404 is, looking at your repository an issue with the configuration of Eleventy.

The .eleventy.js in you repository has

config.addPassthroughCopy("admin");

but of course, that doesn’t exist. src/admin does (now.)

Ah! My bad. While moving the folder to src I forgot to change the code in .eleventy.js. Whatever you told did the trick! Now I can see Netlify login page with login ID and password. Thanks a ton.

However, I ran into another issue that deals with building the site with Netlify. Looks like my site-building is taking time and netlify doesn’t allow more minutes to build the site so it gets failed.

My build deployment is stuck on [Time] Build ready to start and it got failed eventually. Reading through the Netlify issues, I can’t seem to find any workaround for this.

Do you know what went wrong? Here’s the build logs:

1:54:11 PM: Build ready to start
1:54:13 PM: build-image version: 195fbe127e5c374d9c4758652cb62e3b8936a395 (focal)
1:54:13 PM: build-image tag: v4.6.0
1:54:13 PM: buildbot version: 4ac77ee15240cafa5a14a04b6ca18d8959fa98e6
1:54:13 PM: Fetching cached dependencies
1:54:13 PM: Starting to download cache of 467.5MB
1:54:18 PM: Finished downloading cache in 4.918190261s
1:54:18 PM: Starting to extract cache
1:54:27 PM: Finished extracting cache in 9.127129141s
1:54:27 PM: Finished fetching cache in 14.090790714s
1:54:27 PM: Starting to prepare the repo for build
1:54:27 PM: Preparing Git Reference refs/heads/main
1:54:28 PM: Parsing package.json dependencies
1:54:29 PM: Starting build script
1:54:29 PM: Installing dependencies
1:54:29 PM: Python version set to 2.7
1:54:29 PM: Started restoring cached node version
1:54:31 PM: Finished restoring cached node version
1:54:31 PM: Attempting node version '14' from .nvmrc
1:54:31 PM: Downloading and installing node v14.19.1...
1:54:31 PM: Downloading https://nodejs.org/dist/v14.19.1/node-v14.19.1-linux-x64.tar.xz...
1:54:32 PM: Computing checksum with sha256sum
1:54:32 PM: Checksums matched!
1:54:34 PM: Now using node v14.19.1 (npm v6.14.16)
1:54:34 PM: Started restoring cached build plugins
1:54:34 PM: Finished restoring cached build plugins
1:54:34 PM: Attempting ruby version 2.7.2, read from environment
1:54:35 PM: Using ruby version 2.7.2
1:54:36 PM: Using PHP version 8.0
1:54:36 PM: Started restoring cached node modules
1:54:36 PM: Finished restoring cached node modules
1:54:36 PM: Installing NPM modules using NPM version 6.14.16
1:54:51 PM: npm notice created a lockfile as package-lock.json. You should commit this file.
1:54:51 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
1:54:51 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
1:54:51 PM: npm WARN @babel/plugin-syntax-jsx@7.16.7 requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
1:54:51 PM: npm WARN @emotion/babel-plugin@11.7.2 requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
1:54:51 PM: npm WARN ajv-keywords@5.1.0 requires a peer of ajv@^8.8.2 but none is installed. You must install peer dependencies yourself.
1:54:51 PM: npm WARN react-redux@4.4.10 requires a peer of redux@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
1:54:51 PM: added 21 packages from 17 contributors, removed 51 packages, updated 28 packages and audited 989 packages in 14.605s
1:54:51 PM: 159 packages are looking for funding
1:54:51 PM:   run `npm fund` for details
1:54:51 PM: found 3 high severity vulnerabilities
1:54:51 PM:   run `npm audit fix` to fix them, or `npm audit` for details
1:54:51 PM: NPM modules installed
1:54:52 PM: Started restoring cached go cache
1:54:52 PM: Finished restoring cached go cache
1:54:52 PM: go version go1.16.5 linux/amd64
1:54:52 PM: go version go1.16.5 linux/amd64
1:54:52 PM: Installing missing commands
1:54:52 PM: Verify run directory
1:54:53 PM: ​
1:54:53 PM: ────────────────────────────────────────────────────────────────
1:54:53 PM:   Netlify Build                                                 
1:54:53 PM: ────────────────────────────────────────────────────────────────

You might have truncated the deploy log I think.

I tried building your repository locally and encountered this

[11ty] > Having trouble writing template: dist/admin/index.html

`TemplateWriterWriteError` was thrown
[11ty] > Parse Error: <html lang="en>

There is a double quote missing after the en.
You have

<html lang="en>

when you should have

<html lang="en">