Jump to content

Clover13

Clients
  • Posts

    1,403
  • Joined

  • Last visited

  • Days Won

    1

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Clover13

  1. For a Pages DB with many fields (that are collectively the "content"), I want to set the Content marked field as not required and clear all permissions so no one sees it.  My reasoning for this setup in that the N other fields are the effective "content", not a single field.  Of course something will be required, so one could just pick a random required field and mark it as the content field, however I found two issues during my testing of an "optional" Content marked field with no permissions to view/create/edit for any group.

    1. An API request to POST cms/records/{database_id} with the content field either not included or set to "" still returns TITLE_CONTENT_REQUIRED.  However if I define it as a Text field and set it to a space (" "), it will POST successfully.
    2. Regardless of permissions, the Content marked field is always displayed.  Setting it to a space (" ") helps hide this behavior.

    Just passing along, again the workaround is just picking some random field that is required and always displays, then marking it as Content in the DB config, however any templating that iterates with conditionals Above/Below Content is influenced by whatever field is marked as Content.  So you'd have to go with a custom approach (which is what I wound up doing).

     

     

  2. Alright, another issue discovered is even though I have the Content field marked as optional (this is intentional based on my DB and templating design goals as no one field is the content), it is still required in the POST otherwise you'll get a TITLE_CONTENT_REQUIRED exception.  So I had to add the Content field to the request, which I can default to an empty string and hide from all member groups, then it works.

    Now back to the original troubleshooting of whatever it is deeming as an upload field.

  3. I figured it out now.

    Successful POST

    {
        "\/cms\/records\/3\/": "",
        "key": "xxxxxxx",
        "category": "5",
        "author": "1",
        "fields": {
            "12": "Hello",
            "13": "Content"
        }
    }
    RESPONSE
    {
        "id": 11,
        "title": "Hello",
        "category": {
            "id": 5,
            "name": "Records",
            "url": "",
            "class": "IPS\\cms\\Categories3",
            "parentId": 0,
            "permissions": {
                "perm_id": 97,
                "perm_view": "*",
                "perm_2": "*",
                "perm_3": "4,3,6",
                "perm_4": "4,3,6",
                "perm_5": "4,3,6",
                "perm_6": "4,3,6",
                "perm_7": "4,3,6"
            }
        },
        "fields": {
            "field_12": "Hello",
            "field_13": "Content"
        },

     

    Python code in terms of post data:

    post_data = {
    	"category": "5",
    	"author": "1",
    	"fields[12]": "Hello",
    	"fields[13]": "Content",
    }

     

    I was creating a dict for fields as follows that was failing, as it wasn't in the expected format:

    fields = {
    	"12": "Hello",
    	"13": "Content"
    }

    And then dumping it to JSON as an object and POSTing as

    post_data = {
    	"category": "5",
    	"author": "1",
    	"fields": fields_json,
    }

     

  4. Well now I'm baffled.  I set up a simple Pages DB locally with just a title and content and submitted an API POST to create a record.  It did create it but with odd results.

    You can see the request has the field ids and values.  Yet in the response, field_12 (the Title field) shows "o", as does the "title" key's value.  Not sure what's going on there, but will keep digging.

     

    POST /cms/records/3/
    
    REQUEST DATA
    {
        "\/cms\/records\/3\/": "",
        "key": "xxxxxxxxxx",
        "category": "5",
        "author": "1",
        "fields": "{\"12\": \"Hello Title\", \"13\": \"Hello Content\"}"
    }
    RESPONSE
    {
        "id": 2,
        "title": "o",
        "category": {
            "id": 5,
            "name": "Records",
            "url": "",
            "class": "IPS\\cms\\Categories3",
            "parentId": 0,
            "permissions": {
                "perm_id": 97,
                "perm_view": "*",
                "perm_2": "*",
                "perm_3": "4,3,6",
                "perm_4": "4,3,6",
                "perm_5": "4,3,6",
                "perm_6": "4,3,6",
                "perm_7": "4,3,6"
            }
        },
        "fields": {
            "field_12": "o",
            "field_13": " "
        },
    ...
    ...
    ...

     

  5. Troubleshooting a script to create records and running into an exception.

     

    Calling via API:

    POST /cms/records/{database_id}

    Returns: 

    {'errorCode': '1S306/E', 'errorMessage': 'UPLOAD_FIELD_NOT_OBJECT'}

     

    Does this error apply to the image object (Record Image)?

    I only have one other multi-image upload field in the fields object that is optional and I'm not sending it in the POST request at all for my test, so I'm assuming this error is being returned from the image field, but want to confirm before I go down a rabbit hole. 

    P.S.  My script is written in Python, not PHP.

  6. I'm always hoping a dev will come up with an app that allows an upload that goes directly to YouTube, Vimeo, etc and then embeds the video URL into the content (topic, etc).  This saves on server/storage space while also eliminating the browser vs device incompatibility issues.  I'd be willing to pay quite a bit for it, I'm sure many would and collectively it would be worthwhile for the dev.

  7. Just passing a long a list of Events enhancements I feel would be useful for many sites that use Events.

    1.  Door Prizes

    One caveat to Events I've experienced in my communities that maybe IC can add to it in v5 is Door Prizes!

    For some of our in person Events, we have Door Prizes that are given by the site and donated by sponsors,  business, and members.  It's great to highlight these in the Event itself to increase interest in attending, but to also recognize those that may have contributed Door Prizes to the Event (i.e. sponsors, businesses, members, etc).  Adding a layer to the Event that showcases these is very helpful.  In addition, for those who use affiliate linking, it adds another level of viewing/sharing products and generating revenue for the site.

    2. Improve RSVPing with Guest Counts/Management

    Another caveat is managing RSVP details for Events that have limited capacity and not all attendees will be members but may also include their guests.  Allowing a member to RSVP and also manage their guest count is very beneficial as it's not reasonable for all guests to register as members just to RSVP.  This too feeds into accurately planning and managing head counts, ensuring no one gets turned away at the Event, and allocating Door Prizes for Events.

    Just some food for thought as I feel like these are very helpful native features that apply to corporate, small business, and hobby related sites.

  8. The scope of Development Mode below.  So if it works in Development Mode, that should narrow it down to one of those things that is suspended?  Possible there is corrupt JS in the cache?  Have you tried clearing entire cache for the site on CF?

    https://developers.cloudflare.com/cache/reference/development-mode/

    Development Mode

    Development Mode temporarily suspends Cloudflare’s edge caching, minification, Polish, and Railgun (deprecated) features for three hours unless disabled beforehand. Development Mode allows customers to immediately observe changes to their cacheable content like images, CSS, or JavaScript.

     

     

  9. Curious what exactly you are trying to do with #2 and why you may feel this is an IPS sided issue?  I would imagine you are using the Fetch API to make HTTP calls to the IPS REST API to CRUD IPS relative data.  How and what you use to manage the presentation of that data and make calls to the REST API is in your control.  #2 is outside the scope of IPS entirely and based on #1 I would think you are only using IPS for it's backend impl and leveraging it's API to CRUD data within it from your frontend stack of choice.

  10. Not sure why, but started to get emails on a configuration issue regarding a Configuration Issue Detected

    Email body says:

    A configuration issue has been detected on your community which requires your attention.
    Locked Task: sitemapgenerator
    One of the routine maintenance tasks which run in the background has failed several times, which may indicate a configuration issue.

    When I check the site logs for the task it only shows successful runs.  I also have no notifications indicating a problem, so it seems like it probably resolved itself on the next run however this error email comes out pretty much every night.  How do I track down what's happening here, as the IPS AdminCP doesn't seem to show any error or I'm not looking in the right place (nothing in System Logs, Errors Logs, or Task Log).

    Also worth noting, I have another site running on the same IP/host and it does not get this error.

  11. Just now, Randy Calvert said:

    Also most servers /tmp is much smaller by default. Maybe also work with host to up the size of tmp. It won’t fix the underlying issue but could reduce impact.  Or write a script to clean tmp occasionally. 

    If a tmp file exists, it means the upload failed.  Cleanup helps reducing impact to other uploads that would otherwise succeed if those tmp files wouldn't exist however.  Ultimately, we don't want any failures, so it's about trying to figure out what exactly is required for these file uploads.

    FWIW, some of this is related to the ImageMagick policy defined, looking at my server resource limits for it, I see the following which seems quite large, but also tells me that a 20MB image in this case exceeds the 64GB max memory required and goes to disk and that one file eventually fills up the quota.  I'm not exactly sure what the cap is however, but increasing it to 100GB with about 90GB free has thus far eliminated these issues.  20GB of additional free space was insufficient.

    Resource limits:
      Width: 1.1529215EP
      Height: 1.1529215EP
      List length: unlimited
      Area: 265.58GP
      Memory: 61.8342GiB
      Map: 123.668GiB
      Disk: unlimited
      File: 786432
      Thread: 24
      Throttle: 0
      Time: unlimited

  12. 24 minutes ago, DawPi said:

    Hmm, out of space? Just guessing..

    Yes, that is what happened.  The question is why.  20GB of free space available, 20MB file upload and it runs out of space?

    1 minute ago, Ryan Ashbrook said:

    Working with images, particularly large ones, is actually a pretty intensive process. For instance, if I open Affinity Designer, t immediately uses about 750-800MB of memory, then opening a single 1.6 MB file makes memory usage jump to 1 GB. If the files are going to /tmp then it's likely because ImageMagick is running out of memory available to it so it's forced to use disk instead, which has larger space to work with, but is much slower.

    It may be worth contacting ImageMagick with your configuration to see if any improvements can be made.

    Thanks Ryan!  Yeah, that's how I understood it.  Once memory runs out, it goes to disk.  Just mind blowing the amount of space, but I know image processing is intensive, just wasn't thinking that intensive.  Good idea to contact them, will look into that. 

  13. 5 minutes ago, Driven 2 Services said:

    The /tmp directory is often a partition set to a limited site, or a limited size RAM disk.

    It's part of the home directory for the site, but it's possible that specific tmp directory could be partitioned on its own.  However adjusting disk quota in WHM does alleviate the problem, so that leads me to believe it isn't partitioned separately or in a limited way but is tied to the disk quota defined in WHM.

    I guess what's odd is the shear size of what's required to run these images through Imagemagick.  The member sent me a sample file that failed and it was 20MB, but the temp file remaining after the upload failure is 2.3GB and unclear how much space Imagemagick took up on disk before it failed, but I'm assuming upwards of 20GB+ for a single upload/conversion to hit a failure point since that much space was available at the time of failure.  Since increasing the disk quota in WHM and cleaning up the tmp files, the uploads have worked fine, but I shouldn't need 100GB+ of headroom to upload a 20MB file, so something is definitely wonky.

  14. Members are running into upload failures in some cases, not sure why this is happening as there is quite a bit of disk space quota available (40GB) at the time of these failures.  Files are being left behind (2.3GB each on avg) because of the failures and eventually completely capping the disk space quota.  Would a single image take up to 40GB of free disk space when it can't do it all in memory?

    ImagickException::445
    unable to write pixel cache '/tmp/magick-ZvfCYR5vTGWaIyfii_ZaZEePhJOiAI69': Disk quota exceeded @ error/cache.c/WritePixelCachePixels/5852

    #0 /home/xxxxxxxxxxxx/public_html/system/Image/Imagemagick.php(237): Imagick->rotateImage()
    #1 /home/xxxxxxxxxxxx/public_html/system/Image/Image.php(169): IPS\Image\_Imagemagick->rotate()
    #2 /home/xxxxxxxxxxxx/public_html/system/File/File.php(326): IPS\_Image::create()
    #3 /home/xxxxxxxxxxxx/public_html/system/File/File.php(436): IPS\_File::create()
    #4 /home/xxxxxxxxxxxx/public_html/system/Helpers/Form/Upload.php(755): IPS\_File::createFromUploads()
    #5 /home/xxxxxxxxxxxx/public_html/system/Helpers/Form/Upload.php(309): IPS\Helpers\Form\_Upload->processUploads()
    #6 /home/xxxxxxxxxxxx/public_html/init.php(931) : eval()'d code(17): IPS\Helpers\Form\_Upload->__construct()
    #7 /home/xxxxxxxxxxxx/public_html/system/Helpers/Form/Editor.php(766): IPS\Helpers\Form\hook607->__construct()
    #8 /home/xxxxxxxxxxxx/public_html/system/Helpers/Form/Editor.php(185): IPS\Helpers\Form\_Editor->getUploader()
    #9 /home/xxxxxxxxxxxx/public_html/system/Content/Item.php(5092): IPS\Helpers\Form\_Editor->__construct()
    #10 /home/xxxxxxxxxxxx/public_html/system/Content/Item.php(4769): IPS\Content\_Item->commentFormElements()
    #11 /home/xxxxxxxxxxxx/public_html/uploads/template_cache/template_2_7a734b11232065691bc1176040cb26ad_topics.php(5425): IPS\Content\_Item->commentForm()
    #12 /home/xxxxxxxxxxxx/public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_forums_front_topics->topic()
    #13 /home/xxxxxxxxxxxx/public_html/applications/forums/modules/front/forums/topic.php(611): IPS\Theme\_SandboxedTemplate->__call()
    #14 /home/xxxxxxxxxxxx/public_html/system/Dispatcher/Controller.php(118): IPS\forums\modules\front\forums\_topic->manage()
    #15 /home/xxxxxxxxxxxx/public_html/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
    #16 /home/xxxxxxxxxxxx/public_html/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
    #17 /home/xxxxxxxxxxxx/public_html/init.php(931) : eval()'d code(15): IPS\forums\modules\front\forums\_topic->execute()
    #18 /home/xxxxxxxxxxxx/public_html/init.php(931) : eval()'d code(21): IPS\forums\modules\front\forums\ignoretopics_hook_topicController->execute()
    #19 /home/xxxxxxxxxxxx/public_html/init.php(931) : eval()'d code(21): IPS\forums\modules\front\forums\raffles_hook_loadCss->execute()
    #20 /home/xxxxxxxxxxxx/public_html/system/Dispatcher/Dispatcher.php(153): IPS\forums\modules\front\forums\tthumb_hook_forums_module_topic->execute()
    #21 /home/xxxxxxxxxxxx/public_html/index.php(13): IPS\_Dispatcher->run()
    #22 {main}

     

  15. 1 hour ago, Jim M said:

    Wouldn't they just leave the conversation then? Then they wouldn't receive any further communication in that conversation and the user would not be able to message them again.

    It's an option, but in my case, the one member wanted to retain the original conversation up until the point where he blocked the other member so that he had evidence of the situation.  I guess he could have screenshot it all to have the same and then left it.  And yeah I'd imagine leaving it would be a way to achieve the effect desired.

  16. 5 hours ago, Daniel F said:

    This is unfortunately by design.

    We've implemented it this way, that the person who starts the conversation sees all messages, if you send a message to someone, you're always going to want to be able to see their replies.

    Well I think a person would want to see the replies initially but in the event they feel the need to block someone, at that point they no longer want to receive any additional messages.  Ultimately, this particular instance became so problematic, I had to ban both members.  Granted, their conflict was bad content but I'm losing good content they post as well as a result.

×
×
  • Create New...