Comments (9)
This could be related to #2432 but I am unsure since I have not seen S3 uploads breaking. Can you perhaps set your timezone to UTC to see if that allows uploads to work? That will help confirm the source of the issue.
from ctfd.
@ColdHeat I did some digging. It looks like the boto3 upload_fileobj
function silently closes the file object you give it after upload (see boto/boto3#929).
This unfortunate undocumented behavior, along with the addition of
CTFd/CTFd/utils/uploads/__init__.py
Line 50 in 3536c4c
upload_fileobj
. This explains why the returned error is "I/O operation on closed file."
.
I guess this would only be a problem if using S3 to store files for CTFd.
from ctfd.
Thank you for digging into this and figuring out the issue. This is an issue in a feature for 3.7 which explains why I haven't seen it before.
You're welcome to PR a fix but I will tackle this as part of 3.7 as well.
from ctfd.
Likely the simplest fix is to calculate the SHA before uploading because we don't close the file and re-seek to the beginning as well.
from ctfd.
@ColdHeat I can confirm that moving the hash calculated to before the file upload fixes the issue. I can submit a PR. Any idea when this might be pushed to a new hotfix version (maybe 3.6.2?)? This issue is currently causing me some trouble in preparing for an upcoming event.
from ctfd.
Thanks for the PR I stepped out before I could put one up.
I think I would rather wait for 3.7.0. There isn't a significant amount of difference between 3.6.1 and the current commit: 3.6.1...master so if you having issues you could just specifically pin to the 3.6.1 image or to that tag/commit.
from ctfd.
Ok, I'll make it work somehow. I was having some issues with pinning to a tag/commit because it seemed to throw off the database.
from ctfd.
I think now that your fix is merged you should be able to run off of that since the shasum change is the only change that modified the database.
from ctfd.
@ColdHeat Yep that worked. Thank you!
from ctfd.
Related Issues (20)
- Share Template Control
- Feature request - re-evaluate flag-attempts after the regex for a flag is updated during an event
- Custom on submit handler for challenges view
- 3.7.0 change of admin theme breaks backward compatibility HOT 1
- Exports should happen in background and be stored by CTFd as an upload
- core-beta does not respect APPLICATION_ROOT on the scoreboard
- Improve scoreboard API endpoints for scoreboard matrix and top per challenges category
- Scoreboard shows "No solves yet", even though there are solves
- CTFd Plugins conflict too much HOT 9
- Getting dynamic challenges by ID does not return decay function
- Missing translations in 3.7.0, always shown in English HOT 2
- Users cant solve challenge after changing to user mode HOT 3
- Have anyone get this error when run docker desktop ? Pls tell me HOT 1
- I can't run docker-compose up when i git clone code HOT 1
- Display walkthrough/solution by challenge when CTF ends HOT 1
- Container version - issue with plugins, themes, etc. directories HOT 1
- Custom Fields & Brackets visible in User/Team Listings
- [QUESTION] - Upload file in plugins HOT 4
- [Question] Helm chart contribution HOT 4
- Unable to insert media link in form
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctfd.