Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 502 error when editing collection #6924

Open
bradystroud opened this issue Sep 26, 2023 · 5 comments
Open

🐛 502 error when editing collection #6924

bradystroud opened this issue Sep 26, 2023 · 5 comments

Comments

@bradystroud
Copy link
Contributor

bradystroud commented Sep 26, 2023

Describe the bug
502 Error when trying to edit a collection.
This is only effecting some users

8f5fd0ff-6fcf-4cc4-b704-893bce14b08e

Applicable Versions:

  • Decap CMS version: "netlify-cms-app": "^2.15.72"
  • Git provider: GitHub
  • OS: Windows
  • Browser version: Chrome

CMS configuration

https://github.com/SSWConsulting/SSW.Rules/blob/main/src/cms/config.js
import { generateGuid } from '../helpers/generateGuid';

var configJson = {
  config: {
    backend: {
      name: 'github',
      repo: 'SSWConsulting/SSW.Rules.Content',
      branch: process.env.CONTENT_BRANCH,
      open_authoring: true,
      auth_endpoint: '/api/auth',
      always_fork: true,
      base_url: process.env.API_BASE_URL,
      use_graphql: true,
    },
    site_url: 'https://www.ssw.com.au/rules',
    publish_mode: 'editorial_workflow',
    logo_url:
      'https://www.ssw.com.au/ssw/logo/SSWRules/Downloads/SSW%20Rules.png',
    show_preview_links: false,
    search: false,
    media_folder: 'static/assets',
    public_folder: '/assets',
    collections: [
      {
        name: 'rule',
        label: 'Rule',
        sortable_fields: [],
        folder: 'rules',
        media_folder: '',
        public_folder: '',
        slug: 'rule',
        path: '{{uri}}/rule',
        create: true,
        fields: [
          {
            name: 'type',
            label: 'Type(e.g.rule / category)',
            widget: 'hidden',
            default: 'rule',
          },
          { name: 'title', label: 'Title' },
          {
            name: 'uri',
            label: 'uri (a unique identifier for the url)',
            pattern: [
              '^[a-z0-9_-]*$',
              'Must only contain lowercase alphanumeric or the "-" and "_" characters',
            ],
          },
          {
            name: 'body',
            label: 'Body',
            widget: 'markdown',
            default: `Instructions for creating rules can be found at [How to Create Rules](https://github.com/SSWConsulting/SSW.Rules.Content/wiki/How-to-Create-Rules). Follow the steps below and replace the text in this box with your own content.
            
1. Place your intro here. This will show in the blurb.
            
<!--endintro-->

2. Place your content here. Markdown is your friend. See this [example rule](https://www.ssw.com.au/rules/rule) for all the things you can do with Rules.
3. Submit your rule for review.
4. Add your rule to a category. See [How to Add and Edit Categories and Top Categories](https://github.com/SSWConsulting/SSW.Rules.Content/wiki/How-to-Add-and-Edit-Categories-and-Top-Categories).`,
          },
          {
            name: 'authors',
            label: 'Acknowledgements',
            widget: 'list',
            fields: [
              { name: 'title', label: 'Name' },
              { name: 'url', label: 'Profile url', required: false },
              { name: 'img', label: 'Profile image', required: false },
            ],
            default: [{ title: '' }],
          },
          {
            name: 'related',
            label: 'Related',
            required: false,
            widget: 'list',
            field: {
              name: 'relatedRule',
              label: 'Rule uri',
              hint: 'The URI for the related rule, i.e. label-your-assets',
              pattern: [
                '^[a-z0-9_-]*$',
                'Must only contain lowercase alphanumeric or the "-" and "_" characters',
              ],
            },
          },
          {
            name: 'redirects',
            label: 'Redirects',
            required: false,
            widget: 'list',
            field: {
              name: 'redirectUri',
              label: 'Redirect uri',
              hint: 'The URI for the old rule, i.e. label-your-assets',
            },
          },
          {
            name: 'created',
            label: 'Date created',
            widget: 'datetime',
            field: {
              name: 'relatedRule',
              label: 'Rule',
              widget: 'relation',
              collection: 'rules',
              search_fields: ['title'],
              value_field: 'uri',
              display_fields: ['title'],
              options_length: 5,
            },
          },
          {
            name: 'archivedreason',
            label:
              'Archive this rule by adding a reason (leave blank to unarchive)',
            required: false,
          },
          {
            name: 'guid',
            label: 'GUID',
            widget: 'hidden',
            pattern: [
              '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$',
              'Must be a valid GUID',
            ],
            default: generateGuid(),
          },
        ],
      },
    ],
  },
};

export default configJson;
@bradystroud bradystroud added the type: bug code to address defects in shipped code label Sep 26, 2023
@martinjagodic
Copy link
Member

@bradystroud what happens if you upgrade the CMS to decap 3?

@bradystroud
Copy link
Contributor Author

We have a Gatsby site, and use the gatsby-plugin-netlify-cms package
Looks like it hasn't been updated to decap yet, see issue
gatsbyjs/gatsby#38553

There is a PR open, so hopefully it gets updated soon 🙂
gatsbyjs/gatsby#38554

@martinjagodic
Copy link
Member

martinjagodic commented Sep 27, 2023

If those users clear the cache and log in again, does the error still happen?

@martinjagodic
Copy link
Member

@bradystroud how many entries do you have? Is it possible that you are hitting the GitHub rate limit? How does the failed response look in your network tab?

@martinjagodic martinjagodic removed the type: bug code to address defects in shipped code label Oct 20, 2023
@bradystroud
Copy link
Contributor Author

bradystroud commented Jan 1, 2024

Update - we have upgraded from Netlify to Decap CMS but the issue is still there

If those users clear the cache and log in again, does the error still happen?

Yes - the issue persists

how many entries do you have?

@martinjagodic more than 3,200 entries

Is it possible that you are hitting the GitHub rate limit?

Yes - But I would expect an error that says you are hitting the GitHub rate limit if that was the case

How does the failed response look in your network tab?

This error is in the response

Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include 058C:63C7C:D2B60A:E85067:6593434F when reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants