Giter Site home page Giter Site logo

Bulk import issue about ipsk-manager HOT 45 CLOSED

ciscodevnet avatar ciscodevnet commented on August 18, 2024
Bulk import issue

from ipsk-manager.

Comments (45)

ciesinsn avatar ciesinsn commented on August 18, 2024

@pio-gra, I've tried to reproduce this and am unable. Do you have any other details to reproduce it maybe?

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

I'm having a similar issue with bulk import. I get the CSV built according to the template, but it complains of illegal characters. Then I remove everything but the MAC addresses, and it states that all entries are filtered and "Successful Upload with exceptions on unformatted content". I don't believe I have any illegal characters in any of the fields, but it's hard to know when the output doesn't give any meaningful error handling.

Using iPSK manager on RHEL vm in Azure, uploading via Chrome browser.

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro just curious are you using the latest code that was committed a few weeks ago?

Is it possible for you to attach the file you are trying to upload that causes the issue so I can try and reproduce with that same file upload?

Thanks

Nick

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@joe-catanzaro just curious are you using the latest code that was committed a few weeks ago?

Is it possible for you to attach the file you are trying to upload that causes the issue so I can try and reproduce with that same file upload?

Thanks

Nick

hey Nick. this instance was just installed and brought running last week, I did run a git pull and it stated it's up to date.

I had to sanitize the file of the email address field, but that didn't seem to be the one that was causing problems. It seemed to be more the description field. Are there any character count limitations on that field? And I assume underscores are ok in the email field? I.e. [email protected]

problem file.csv

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@joe-catanzaro just curious are you using the latest code that was committed a few weeks ago?
Is it possible for you to attach the file you are trying to upload that causes the issue so I can try and reproduce with that same file upload?
Thanks
Nick

hey Nick. this instance was just installed and brought running last week, I did run a git pull and it stated it's up to date.

I had to sanitize the file of the email address field, but that didn't seem to be the one that was causing problems. It seemed to be more the description field. Are there any character count limitations on that field? And I assume underscores are ok in the email field? I.e. [email protected]

problem file.csv

@ciesinsn realized I forgot to tag, hopefully you saw this.

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro The file you attached I'm able to upload just fine, I assume it may be something in your description causing the issue. There is a filter that checks for invalid characters when a file is uploaded. When you upload the file do you see the count for invalid characters be anything other then zero? A code comment states " is a illegal character but I've found that & is also triggering the invalid character count and breaking a upload even though & is in the regular expression list. By chance are you using either of those in your file?

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro so this is when you try to upload the file you attached the other day? I have no issues with that file. Can you include a screenshot of the screen that shows whats been uploaded/filtered (the count). What version of PHP are you using and what OS is this on? Also, can you attach your php.ini file.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@joe-catanzaro so this is when you try to upload the file you attached the other day? I have no issues with that file. Can you include a screenshot of the screen that shows whats been uploaded/filtered (the count). What version of PHP are you using and what OS is this on? Also, can you attach your php.ini file.

Yes, same file.

bulk upload fail

This is running on RHEL 9.2, PHP version info below:

PHP 8.0.30 (cli) (built: Aug 3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies

PHP ini attached also
ipskmanager php ini.txt

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro, I'm on PHP 8.2 and our php.ini's are almost identical. Looking at your file as-is again (without my testing changes), I get the same issue. But after looking at the code I see why. Your file doesn't have a email listed and email is a required field.

if($tempMacAddress != "" && $tempFullname != "" && $tempEmail != ""){
$csvFile[$entryCount]['macAddress'] = $tempMacAddress;
$csvFile[$entryCount]['fullname'] = $tempFullname;
$csvFile[$entryCount]['emailaddress'] = $tempEmail;
$csvFile[$entryCount]['description'] = filter_var(trim($temp[$fieldMapping['description']]),FILTER_SANITIZE_STRING);
$entryCount++;
}else{
$filtereditems++;
}

Once you put a email in it should fix the filter issue (hopefully) and I think my pushed fixed for & will solve the description issue if that was a character you where using.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

ipsk illegal char

@ciesinsn

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro, it was the underscore causing a issue. It was another character not being handled properly by the illegal character check along with &. I pushed a fix already and it does work for me. Give it a try and see if it fixes it for you as well.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@ciesinsn so now I've done the git pull, restarted the box etc., and I can't get any file to upload to it now. Using chrome, i've updated the browser and disabled adblockers etc. but nothing happens when i click the upload button.

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro when was the last time you did a pull? The only things changed regarding this particular issue was two modifications to one line of code to handle a & and _ being in the CSV text. Is there any sort of error if you open developer tools on the browser?

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@ciesinsn did it again today just to be sure, return was 'already up to date'. In the dev tools I see this:

devtool error

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

Can you try and back rev that file only? That was the only one changed. Don't understand why you'd have a issue and I wouldn't, especially for the minor change that was done.

On Wed, Nov 15, 2023 at 1:33 PM joe-catanzaro @.> wrote: @ciesinsn https://github.com/ciesinsn did it again today just to be sure, return was 'already up to date'. In the dev tools I see this: [image: devtool error] https://user-images.githubusercontent.com/150154731/283227721-63a08bc5-5b93-4b1c-b5ef-572c9d6f234f.PNG — Reply to this email directly, view it on GitHub <#23 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI5G4RIBBOCNXGWEZ5LW673YEUKKHAVCNFSM6AAAAAAQCESLA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJTGE2DANRXGQ . You are receiving this because you were mentioned.Message ID: @.>

@ciesinsn sorry, how would I do that?

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

https://github.com/CiscoDevNet/iPSK-Manager/tree/7db641c58a722e680fe16898b11b0b48bb59e683/adminportal/ajax

Pull file from that link and manually put it in place. @joe-catanzaro

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@ciesinsn ok, back rev'ed that file and noticed it was set for root as owner not apache. Fixed that, restarted HTTPD and still getting the same condition when I click 'upload' (nothing happens) but no more error in the dev tools console.

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

I don't think I had done a pull since initial installation up until the update for this issue. I've used two different versions of that file, the 'problem file' is a copy of the actual one i've been working off of

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

pulled a new template file, copied in some mac values and populated other values but same condition. it recognizes the file, lights up the upload button, but clicking 'upload' doesn't do anything and nothing happens in the dev console.

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro I can not reproduce any issue like that and I've tried a few files. Did you clear cache/history/etc.. in browser already?

Also, from within developer tools you should see in the network tab when you press upload it should place a new fileupload.php in the list, does it? if it does click it, go to the response tab, what is shown there, anything?

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

Yes, I do see a new fileupload.php being generated each time. Output from response page attached.
Uploading response page.txt…

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro Looks like the file didn't upload right on your last message

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

response page.txt

May not have waited long enough

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro Still think something isn't right with that file upload. There is a lot of text/code in it referencing github.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

I created a new CSV, manually typed in everything except I copy/paste values for the MAC addresses, nothing happens when I click upload.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

opened the CSV in notepad, nothing out of the ordinary in the file
csv notepad

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro I meant the upload of that response data from the web debugger

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

is it maybe something to do with the fileupload.php file?

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro This is what I'm looking for from you from the developer tools in a browser which isn't coming through on your attachments in github correctly.

image

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

Yes, all that text in the file I sent is what comes up in the 'response' tab

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro The text in the file you attached when I downloaded it has a lot of text that says "github". That in no way should be in that file.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

@joe-catanzaro The text in the file you attached when I downloaded it has a lot of text that says "github". That in no way should be in that file.

Something for sure went wrong pulling down that fileupload.php file. Going to try replacing it

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

ok, fixed the fileupload.php file and now I'm at least getting responses, but back to square one with all of the csv's we've been working with here.

problem file still fails with Successful Upload with exceptions on unformatted content, illegal characters

original file with blank descriptions sees same failure as above

newly created file fails with Invalid CSV Header Attributes, even though they're identical to the template

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro Sure you have the latest version of the fileupload.php file? I've tried all your files and don't have any issues with the changes in the latest version. I even hand typed a few lines of your image a few messages above and don't have a issue.

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

I've tried with both the previous version as well as the most recent one, doesn't seem to make a difference.

I think the more concerning thing is the file I hand typed out including headers and it's saying 'invalid header attributes'.

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro can you past in what line 105 looks like in your current fileupload.php file? Also, is there anything in the developer tools response other then just the one line of json with the counts of each issue?

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

Line 105 reads:

$tempEntrydata = filter_var(trim($data),FILTER_VALIDATE_REGEXP, Array('options'=> Array('regexp' => "/^(?:([a-z]|[A-Z]|[0-9]|-|:|,|'|@|\.|;|\/|\(|\\|\&|#|\*|\s){1,})$/")));

Doesn't look like the underscore is in there.

Nothing other than the single line of JSON in the response

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro That is not the latest file then. It's also missing the & fix

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

aha. that did it.

apparently what appeared to be the most recent file that I was looking at in github was not.

I went in and replaced line 105 with the updated version and now it worked. Thank you so much for your responsiveness and assistance with this!

from ipsk-manager.

ciesinsn avatar ciesinsn commented on August 18, 2024

@joe-catanzaro no problem on the assistance. So just wanted to make sure, it sounds like all your uploads are working now, is that the case? if so I'll probably close out this mile long issue :)

from ipsk-manager.

joe-catanzaro avatar joe-catanzaro commented on August 18, 2024

from ipsk-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.