SasView / sasmodel-marketplace

A website for sharing custom sasmodel files
1 stars 2 forks source link

Unable to upload c file to marketplace (Trac #1044) #12

Closed wpotrzebowski closed 5 years ago

wpotrzebowski commented 5 years ago

When trying to upload c file to marketplace I get following error:

Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python']. 

However accoriding to MAC filetype is correct, e.g.

file -I barbell.c
barbell.c: text/x-c; charset=us-ascii

Migrated from http://trac.sasview.org/ticket/1044

{
    "status": "closed",
    "changetime": "2018-09-05T12:40:14",
    "_ts": "2018-09-05 12:40:14.939139+00:00",
    "description": "When trying to upload c file to marketplace I get following error:\n\n{{{\nFiles of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python']. \n}}}\n\nHowever accoriding to MAC filetype is correct, e.g.\n{{{\nfile -I barbell.c\nbarbell.c: text/x-c; charset=us-ascii\n}}}",
    "reporter": "wojciech",
    "cc": "",
    "resolution": "fixed",
    "workpackage": "SasView Bug Fixing",
    "time": "2017-12-07T10:59:41",
    "component": "sasmodels Markeplace",
    "summary": "Unable to upload c file to marketplace",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.2.0",
    "owner": "tim",
    "type": "defect"
}
butlerpd commented 5 years ago

Trac update at 2018/02/13 14:29:21:

wpotrzebowski commented 5 years ago

Trac update at 2018/02/28 11:08:06: wojciech commented:

I've checked it again and there still seems to be an issue.

wpotrzebowski commented 5 years ago

Trac update at 2018/02/28 12:01:44: wojciech commented:

I've also asked colleague with OSX to test and she reports same error

sasview-bot commented 5 years ago

Trac update at 2018/02/28 15:47:33: tim commented:

I've not encountered any problems with this (running 10.13.3), however, it's treating the .c file as ASCII text; perhaps if there's a program that 'owns' the .c extension it might modify its behaviour?

wpotrzebowski commented 5 years ago

Trac update at 2018/03/05 09:30:38: wojciech commented:

I've tested it on 10.11 and 10.12 (don't have access to 10.13) and on both I've encoutered the problem. However, it seems to be the issue with some models, e.g. cylinder.c and barbell.c fail to upload while core_shell_sphere.c works.

I've tested fresh (pulled from github) models as I thought that editing program modifies the extenstion but it doesn't seem to be the case.

ajj commented 5 years ago

Trac update at 2018/03/06 14:22:57: ajj commented:

Notes from discussion at conf call:

rprospero commented 5 years ago

Trac update at 2018/03/06 15:25:58: awashington commented:

I can confirm the same error message under Nixos using Firefox as the browser. Just from the error message, it looks like the server isn't getting the expected mime type.

rprospero commented 5 years ago

Trac update at 2018/03/06 15:42:12: awashington commented:

Just checking around a bit, my system assigns the mime-type text/plain to .c files, so the server is correctly getting the data sent by the client. I'm thinking that our best bet is to update the marketplace to accept text/plain files as well?

rprospero commented 5 years ago

Trac update at 2018/03/06 15:47:33: awashington commented:

I've submitted a pull request on sasmodel-marketplace that should correct the issue.

wpotrzebowski commented 5 years ago

Trac update at 2018/03/13 07:41:42: wojciech commented:

I suppose the fix should work now as it should be automatically deployed on the marketplace server? I still cannot upload some of the c files.

rprospero commented 5 years ago

Trac update at 2018/03/16 13:56:21: awashington commented:

I have just confirmed that I can upload C files to the server from Linux, which I was not able to do before the fix. Are you still getting the error message

Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python'].
wpotrzebowski commented 5 years ago

Trac update at 2018/03/19 13:10:56: wojciech commented:

Yes, I am stil getting the same error: Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python'].

wpotrzebowski commented 5 years ago

Trac update at 2018/04/17 04:24:21: wojciech commented:

It doesn't work for most of the models (e.g. cylinder, barbell, bcc_paracryystal, capped_cylinder). I haven't check them all but two models that I know I can upload are: hollow_rectangular_prism_thin_walls and rectangular_prism.

wpotrzebowski commented 5 years ago

Trac update at 2018/04/17 14:03:18: wojciech commented:

Clearing cache doesn't help. Using Safari doesn't make it work either.

butlerpd commented 5 years ago

Trac update at 2018/08/01 00:08:59:

Just tried manually updating the core_shell_parallelepiped model since we have fixed the incorrect code. I am using a Dell windows PC running Windows 7 Enterprise. I successfully deleted the c and py files and uploaded the new py file. I was also able to update the description. However when trying to upload the c file I get the same error as follows:

Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python']

Am updating the title of the ticket since it is clearly not just macs.

sasview-bot commented 5 years ago

Trac update at 2018/09/05 12:40:14:

This has been 'fixed', more details can be found here: http://trac.sasview.org/wiki/DevNotes/Processeses/MarketplaceDeployment